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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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: