Why is xmpMetadata.rawData always empty?
The only way I've been able to get at the metadata on a layer is like this:
function dump(obj) {
var out = '';
for (var i in obj) {
out += i + ": " + obj[i] + "\n";
}
return out;
};
dump(doc.artLayers[i].xmpMetaData);
This returns a string with the properties parent, rawData and typename and their associated values including all of the layer metadata. So why does doc.artLayers.xmpMetaData.rawData not contain anything? This fails every time:
try{
xmp = doc.artLayers[i].xmpMetadata.rawData;
xmpObject = new XMPMeta(xmp);
}catch(e){
alert("failed to create xml object");
}
What's going on here? Why do I have go through the awkward parsing above to get at the metadata?
