#34413 [NEW]: DOMXPath->query() ignores context nodes

From: Date: Wed, 07 Sep 2005 20:07:25 +0000
Subject: #34413 [NEW]: DOMXPath->query() ignores context nodes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84646@lists.php.net to get a copy of this message
From: thisisroot at gmail dot com Operating system: Mac OS 10.4.2 PHP version: 5.0.5 PHP Bug Type: XML related Bug description: DOMXPath->query() ignores context nodes Description: ------------ DOMXPath->query() seems to totally ignore context nodes. I get an empty DOMNodeList when I execute a query with a context node. P.S.: Your bug submission process is a real PITA. Could we have just one CAPTCHA, please? Reproduce code: --------------- // I just deleted the real code, but here's a sample // Assume the document and xpath parser have already been // instantiated. /* $doc = <kvps> <string> <key>My Key</key> <value>My Value</value> <string> </kvps> */ $nodes = $xpath->query( '//string'); foreach ( $nodes as $node) { print_r( $node); $key = $xpath->query( '//key', $node); echo $key->nodeValue . "\n"; print_r( $key); } Expected result: ---------------- I expect $key to be the DOMElement tagged as "key" inside of the current "string" element. Actual result: -------------- An empty NodeList -- Edit bug report at http://bugs.php.net/?id=34413&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34413&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34413&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34413&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34413&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34413&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34413&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34413&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34413&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34413&r=support Expected behavior: http://bugs.php.net/fix.php?id=34413&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34413&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34413&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34413&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34413&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34413&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34413&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34413&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34413&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34413&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34413&r=mysqlcfg

« previous php.bugs (#84646) next »