error :"string does not uniquely describe"...
Brought to you by:
bs_php,
nigelswinson
From: narmataru <nar...@ho...> - 2002-06-05 09:09:09
|
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.=20 there is the with the getAttributes(), getData and with the = getDataParts() function too ! it looks strange, no ?=20 thank tou for your answer. from :: nar...@ho... /***************************************************************** that = works good require_once("XPath.class.php"); $xpath =3D new XPath(); $xpath->importFromFile("error.xml"); $xreq =3D "file://error[@id=3D'-100']"; $attribute =3D $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 =3D "file://error[@id=3D'-100']"; $attribute =3D $this->_xPathObj->getAttributes($xreq); $value =3D $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=3D'-100'] XPath error in XPath.class.php:1117 The //error[@id=3D'-100'] does not = evaluate to a single node in this document. |