PHP 5 & DomXpath

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


When I use the followng code:

$dom = new domDocument;
$xpath = new domXPath($dom);
$results = $xpath->query('/');

I get the following error message on the last line:

Warning: Invalid XPath Context in [...] on line [...]

I have a feeling I can fix this problem by calling:


but am unsure about which arguments to use.

Thanks In Advance for any pointers.


Site Timeline