DomQuery::load();

Loads source data into the DOMDocument object. You may optionally specify an initial XPath expression to apply to the source. If you set $return to TRUE, it will return an instance of XPathResultIterator which will contain the results of the applied expression.

 try
 {
     $DomQuery = new DomQuery;
     $DomQuery->load($xml, '//root/foo');
 }
 catch(DOMException $Exception)
 {
     echo $Exception->getMessage();
 }

Definition:

public function load($source, $path = null, $return = false)

Parameters:

Name Type Description
$source String | Array | DOMDocument Source data to pass into the DOMDocument object.
$path String An XPath expression may be immediately executed after loading XML.
$return Boolean Return the result set rather than a self instance.

Recent Discussions

No discussions yet!