I am using php's simple xml and xpath to parse an rdf xml file and am struggling to get a list of all the rdf:about values.
Any advice?
I am using php's simple xml and xpath to parse an rdf xml file and am struggling to get a list of all the rdf:about values.
Any advice?
There seems to be an issue when using SimpleXml with namespaced attributes prior to PHP5.3. Basically, anything with a
:
will be dropped when converted to an object property of a SimpleXml element. The following will do, but feels hackish to me:See here:
You could use DOM instead of SimpleXml:
But, I suggest using a dedicated library for this over SimpleXml or DOM:
And here's a blog post about the parsers: