DomQuery::path();

Applies an XPath query to the current document. If $return is set to TRUE, this method will return an instance of XPathResultIterator containing the results. You may also run an XPath expression on an existing DOMNode instance.

 $DomQuery = new DomQuery;
 $DomQuery->load($xml);
 $DomQuery->path('//root/foo');
 $XPathResultIterator = $DomQuery->path('//root/foo', true);

Definition:

public function path($path, $return = false, DOMNode $Context = null)

Parameters:

Name Type Description
$path String XPath query to execute.
$return Boolean Return the result set rather than a self instance.
$Context Object You may run an XPath query on a specific element.

Recent Discussions

No discussions yet!