Bug #67474 [Opn]: getElementsByTagNameNS and default namespace

From: Date: Thu, 19 Jun 2014 13:40:27 +0000
Subject: Bug #67474 [Opn]: getElementsByTagNameNS and default namespace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186258@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67474&edit=1 ID: 67474 User updated by: pgtest at gmail dot com Reported by: pgtest at gmail dot com Summary: getElementsByTagNameNS and default namespace Status: Open Type: Bug Package: DOM XML related Operating System: Windows 7 x64 SP1 PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: DOM documentation to consider with regard of expected getElementsByTagNameNS behavior: http://www.w3.org/TR/dom/#concept-getelementsbytagnamens http://www.w3.org/TR/dom/#concept-element-namespace Previous Comments: ------------------------------------------------------------------------ [2014-06-19 12:57:39] pgtest at gmail dot com Sorry, made a mistake with regards of actual behavior of getElementsByTagNameNS. The correct description would be: When trying to get all elements from the default namespace (by providing an empty string first argument) getElementsByTagNameNS returns no elements. Actual result: 0 ------------------------------------------------------------------------ [2014-06-19 09:02:46] pgtest at gmail dot com Description: ------------ When trying to get all elements from the default namespace (by providing an empty string first argument) getElementsByTagNameNS returns elements from ALL namespaces. In the provided example, getElementsByTagNameNS should return only the first "a" element, not both. Test script: --------------- $doc = new DOMDocument(); $doc->loadXML('<root xmlns:x="x"><a/><x:a/></root>'); $list = $doc->getElementsByTagNameNS('', 'a'); echo $list->length; Expected result: ---------------- 1 Actual result: -------------- 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67474&edit=1

« previous php.bugs (#186258) next »