Re: error :"string does not uniquely describe"...
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-06-05 10:56:39
|
Please send us your error.xml file. It sounds likely that there is more than one error node with an @id attribute of -100. Without seeing the xml file, then we can only guess... Please also tell us what version of the class you are using. Thanks, Nigel =========================== For the most recent version of Php.XPath, V2.x, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath ----- Original Message ----- From: narmataru To: php...@li... Sent: Wednesday, June 05, 2002 10:14 AM Subject: error :"string does not uniquely describe"... hello, when i use an XPath object into another php class, it always print the error : "The supplied string does not uniquely describe a node in the xml document: " even if i'm sure that my request must give only one node since i use an id into my xml tags. there is the with the getAttributes(), getData and with the getDataParts() function too ! it looks strange, no ? thank tou for your answer. from :: nar...@ho... /***************************************************************** that works good require_once("XPath.class.php"); $xpath = new XPath(); $xpath->importFromFile("error.xml"); $xreq = "file://error[@id='-100']"; $attribute = $xpath->match($xreq); print_r($attribute."<hr>"); print("value : ".$attribute[0]."<br>"); print("attrib : ".$attribute["type"]."<br>"); /***************************************************************** /***************************************************************** it doesn't work ! class toto{ ... function nextError(){ // get datas into the xml file file://$xreq = "file://error[@id='-100']"; $attribute = $this->_xPathObj->getAttributes($xreq); $value = $this->_xPathObj->getData($xreq); } ... } the error dispayed is : XPath error in XPath.class.php:868 The supplied string does not uniquely describe a node in the xml document: //error[@id='-100'] XPath error in XPath.class.php:1117 The //error[@id='-100'] does not evaluate to a single node in this document. |