?

Log in

No account? Create an account

Previous Entry | Next Entry

WTF coding #5b - Specifications III

And again I'm experiencing the joy and fun of "interpreting standards".

This time, it's a document metadata format called "XMP". It is a subset/extension
of a W3 recommendation for metadata, defined by Adobe and thus read by most applications
who care about metadata in the first place.

XMP stores the serialized data in an XML format... which would be awesome... if it
weren't for the fact that it allows you (i.e. the writing application) to chose between
half a dozen ways of expressing the same content. And I'm not talking about the
optional stuff that XML lets you do, that's what we have XML parsers for.

Reading XMP metadata in a reliable and non-lossy way turned out to be more than a
few hours of work. What the specs are clearly missing, is a simple parsing rule
overview in the style of: "if this condition is met, the content is a..." - the
information is there, but randomly distributed across the entire document. It's
another case of "implement all at once or nothing at all"

So... after spending hours and hours on implementing the "xml:lang" support
for multiple language versions of the same content, I gave it a test run...

   <dc:title>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">Test</rdf:li>
     <rdf:li xml:lang="de-DE">Versuch</rdf:li>
    </rdf:Alt>
   </dc:title> 


The above fragment was created by my code. According to the specs, the language
alternative encoding for the "Dublin Core Title" is correct.

I tried that fragment as a sidecar metadata file for a camera raw picture and
low and behold: Adobe Bridge actually displays "Test" as a title for it!
Yay! ... umm ... but what about the other language? There doesn't seem to be a way
of accessing that content in the UI. Better yet... when I edit the property in the
UI, Bridge (or the Adobe XMP library more likely) changes the fragment to the
following content:

   <dc:title>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">Test, 2</rdf:li>
     <rdf:li xml:lang="de-DE">Test, 2</rdf:li>
    </rdf:Alt>
   </dc:title> 


...which is a bit pointless IMHO. Granted, the changed title in one language is
likely to need reflection in the others... but just dumping all and replacing them
with the entered text? Really?

So, this is another prime example of the vendor who actually came up with the
standard implementing it in a semi-serious way only. How can one win in this game?

Latest Month

September 2018
S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Tags

Powered by LiveJournal.com
Designed by Katy Towell