Bug #67474 [Com]: getElementsByTagNameNS and default namespace
| From: | arnoutboks at gmail dot com | Date: | Thu, 22 Dec 2016 10:55:32 +0000 |
| Subject: | Bug #67474 [Com]: getElementsByTagNameNS and default namespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206188@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
Comment by: arnoutboks 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:
I'm working on a patch for this bug.
Previous Comments:
------------------------------------------------------------------------
[2014-06-19 13:40:27] pgtest at gmail dot com
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
------------------------------------------------------------------------
[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