Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions XPath.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5820,7 +5820,6 @@ function getDataParts($xPathQuery) {
$attribute = $matches[2];
if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
$this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
continue;
}
return array($this->nodeIndex[$absoluteXPath]['attributes'][$attribute]);
} else if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $xPathQuery, $matches)) {
Expand Down Expand Up @@ -5967,7 +5966,7 @@ function &_xml2Document($xmlString) {
XML_OPTION_CASE_FOLDING => $this->getProperties('caseFolding'),
XML_OPTION_SKIP_WHITE => $this->getProperties('skipWhiteSpaces')
);
$xmlParser =& new XPathEngine($xmlOptions);
$xmlParser = new $XPathEngine($xmlOptions);
$xmlParser->setVerbose($this->properties['verboseLevel']);
// Parse the XML string
if (!$xmlParser->importFromString($xmlString)) {
Expand Down Expand Up @@ -6225,7 +6224,7 @@ function _title($title) {

// The sample code:
$xmlOptions = array(XML_OPTION_CASE_FOLDING => TRUE, XML_OPTION_SKIP_WHITE => TRUE);
$xPath =& new XPath(FALSE, $xmlOptions);
$xPath = new $XPath(FALSE, $xmlOptions);
//$xPath->bDebugXmlParse = TRUE;
if (!$xPath->importFromString($xmlSource)) { echo $xPath->getLastError(); exit; }

Expand Down Expand Up @@ -6262,4 +6261,4 @@ function _title($title) {
echo $xPath->exportAsHtml();
}

?>
?>