[PHP] Re: SimpleXML and xpath woes

2005-03-17 Thread Simon Turvey
Rob Richards kindly sent me the following response via email - posting it here as he's not subscribed. You need to register a namespace for XPath since there's a default namesapce. $xml = simplexml_load_file('test.xml'); /* Register arbitrary namesapce prefix for xpath*/ $xml->registerXPathNames

[PHP] SimpleXML and xpath woes

2005-03-17 Thread Simon Turvey
, when: $query = '//ItemLookupResponse'; var_dump returns: array(0) { } Either a) I'm doing something terribly wrong (and I thought that I was attempting a pretty simple xpath query) or b) SimpleXML's broken. I'd prefer a) - it's easier to fix :) Thank