Open wakanawakana opened 6 years ago
I am trying to embed MWG tags in XMP. I do not know how to access the child elements of XML(RDF) and attribute. Please tell me if there is any way.
http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf
exempi.register_namespace("http://www.metadataworkinggroup.com/schemas/regions/", u"mwg-rs") exempi.register_namespace("http://ns.adobe.com/xap/1.0/sType/Dimensions#", u"stDim") exempi.register_namespace("http://http://ns.adobe.com/xmp/sType/Area#", u"stArea") mwg_rs_ns = exempi.prefix_namespace_uri(u"mwg-rs") starea_ns = exempi.prefix_namespace_uri(u"stArea") xmp = exempi.new_empty() exempi.append_array_item(xmp, mwg_rs_ns, "RegionList", consts.XMP_PROP_VALUE_IS_ARRAY, "", 0) exempi.set_property_float(xmp, starea_ns, "x", 0.5, 0) options = consts.XMP_SERIAL_OPTIONS['omit_packet_wrapper'] output = exempi.serialize_and_format(xmp, options, 0, '\n', ' ', 0)
output
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Exempi + XMP Core 5.6.0"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/" xmlns:stArea="http://http://ns.adobe.com/xmp/sType/Area#"> <mwg-rs:RegionList> <rdf:Bag> <rdf:li/> </rdf:Bag> </mwg-rs:RegionList> <stArea:x>0.500000</stArea:x> </rdf:Description> </rdf:RDF> </x:xmpmeta>
Simple image region samples
I am trying to embed MWG tags in XMP. I do not know how to access the child elements of XML(RDF) and attribute. Please tell me if there is any way.
http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf
output
Simple image region samples![image](https://user-images.githubusercontent.com/24972079/38239103-c66d3078-3766-11e8-87be-64ce76b942c0.png)