Bug #67474 [Opn]: getElementsByTagNameNS and default namespace
| From: | pgtest at gmail dot com | Date: | Thu, 19 Jun 2014 12:57:39 +0000 |
| Subject: | Bug #67474 [Opn]: getElementsByTagNameNS and default namespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186257@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:
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
Previous Comments:
------------------------------------------------------------------------
[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