dordal Posted October 8, 2007 Share Posted October 8, 2007 Folks- I'm having trouble debugging xpath queries. I have code that looks like this: $dom = new DOMDocument(); @$dom->loadHTML($code); // $code contains an HTML document $xpath = new domxpath($dom); $xDataNodes = $xpath->query('//table[@id="foo"]/*'); So threoretically, $xDataNodes should contain a DOMNodeList with all of the child elements of the table with id 'foo'. For debugging, how do I verify this and look at the contents of $xDataNodes? print_r() and var_dump() don't work, and a previous suggestion doesn't work for DOMNodeList's thx Quote Link to comment https://forums.phpfreaks.com/topic/72353-printing-a-domnodelist/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.