Page 1 of 1

another xpath question

Posted: Wed Feb 10, 2010 2:27 pm
by yacahuma
xpath did not like the following

Code: Select all

 
    define("XMLNS_SOAPENV", "http://schemas.xmlsoap.org/soap/envelope/");
    define("XMLNS_XSI", "http://www.w3.org/2001/XMLSchema-instance");
$xpathQuery= "//mESN[string-length()>18]/text()";     //ERRROR 
$root = simplexml_load_string('xxxx');
$root->registerXPathNamespace("a", XMLNS_SOAPENV);
$arr= $root->xpath('a:' . $xpathQuery);
 
Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid expression in C:\tst_run_plan.php on line 151
Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: xmlXPathEval: evaluation failed in C:\tst_run_plan.php on line 151


What is wrong with the query. It works on a x_path query test tool.