Hi,
I have started using v5.1.2 of the ToolKit, and I have run into a problem.
In the XMP specification Part 2 page 9 states:
The namespaces define a set of properties. In any given XMP Packet, a property may be absent or present:
•Absent: The property has no value. Properties are absent until given a value for the first time.
•Present: The property has a defined value. A present property may have the empty string as its value; this is different from an absent property. However, writers are encouraged not to set properties with a value of the empty string.
But version 5.1.2 of the XMPToolKit removes empty properties in some cases (as opposed to v4.4.2).
One example is the ApplyTemplate function. The function removes all empty properties / structures when merging two XMP
To see an example of this add an extra property at line 138 in XMPCoreCoverage.cpp :
staticconstchar * kSimpleRDF =
" <rdf:Description rdf:about='Test:XMPCoreCoverage/kSimpleRDF' xmlns:ns1='ns:test1/' xmlns:ns2='ns:test2/'>"
""
" <ns1:SimpleProp>Simple value</ns1:SimpleProp>"
" <ns1:SimplePropEmpty></ns1:SimplePropEmpty>"
""
" <ns1:ArrayProp>"
When you run the example, the "SimplePropEmpty" property gets removed by the ApplyTemplate function.
If you look in the code of the XMPToolKit it actually looks like this is done on purpose. One example, lines 709 - 715 in XMPUtils-FileInfo.cpp:
if ( valueIsEmpty ) {
if ( deleteEmpty && (destNode != 0) ) {
delete ( destNode );
destParent->children.erase ( destPos );
}
return;// ! Done, empty values are either ignored or cause deletions.
}
But if there is to be difference between absent and present, but empty, properties, then these should be preserved (?)
Thomas