php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25900 DomDocument->get_elements_by_tagname('tagName') doesn't find elements
Submitted: 2003-10-18 10:52 UTC Modified: 2003-10-20 11:42 UTC
From: Martin dot Honnen at arcor dot de Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.3.3 OS: Windows XP
Private report: No CVE-ID:
 [2003-10-18 10:52 UTC] Martin dot Honnen at arcor dot de
Description:
------------
Testing with PHP 4.3.3 on Windows and DOMXML setup as

DOM/XML 	enabled
DOM/XML API Version 	20020815
libxml Version 	20507
HTML Support 	enabled
XPath Support 	enabled
XPointer Support 	enabled
DOM/XSLT 	enabled
libxslt Version 	1.0.30
libxslt compiled against libxml Version 	2.5.7

I encounter a problem with get_elements_by_tagname called on the document node, it doesn't find elements in the document.
Example XML document is at
  http://home.arcor.de/martin.honnen/phpBugs/domxml/xhtmlExample1.xml
a test PHP program demonstrating the problem is at
  http://home.arcor.de/martin.honnen/phpBugs/domxml/get_elements_by_tagnameTest1.php


Reproduce code:
---------------
http://home.arcor.de/martin.honnen/phpBugs/domxml/get_elements_by_tagnameTest1.php

Expected result:
----------------
The test program calls get_elements_by_tagname on the document node and calls the method again on the documentElement node, both calls should find the same elements (and number of elements, in the example one element).

Actual result:
--------------
get_elements_by_tagname called on the document node doesn't find any elements while the method called on the documentElement node finds one element.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-20 11:42 UTC] rrichards@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 10:03:03 2014 UTC