This morning I had a bit of a challenge parsing Adobe XMP information for images on Underwater Focus. The Adobe XMP is too complex for SimpleXML, and anyway, I only needed a few values — one of them, the LightRoom hierarchicalSubject keywords, is the reason I’m sharing some of the code I wrote.
Using regular expressions to get at single values is quick and easy, but I wanted to create arrays for rdf:li
values, and split each lr:hierarchicalSubject
keyword into an additional second-dimension array.