|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-07 23:44 UTC] sniper@php.net
[2005-09-08 08:46 UTC] chregu@php.net
[2005-09-08 08:48 UTC] chregu@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 01:00:01 2025 UTC |
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