Monthly Archives: June 2011

Parsing XML: xpath attributes

Posted by & filed under PHP.

Here are two examples of getting attribute values using an xpath query: one using simpleXML and one using DOM document. Both queries are on namespaces within the XML file. First here’s the DOM Document version: … and the SimpleXML version: