ID: 28188 Updated by: [EMAIL PROTECTED] Reported By: hans at deragon dot biz -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: Red Hat Linux 9 PHP Version: 4.3.4 New Comment:
Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. . Previous Comments: ------------------------------------------------------------------------ [2004-04-27 20:20:59] hans at deragon dot biz Description: ------------ When executing $node->get_elements_by_tagname("text"); it is not only the tag named "text" that is returned, but all tags named "#text". This is wrong. I am searching for all "text" nodes that are to be found in the input xml file, not those who are named #text and are domtext elements. Why do domtext element have a name and why are they returned? The documentation for states "Every element of the array is an DomElement.". Not true as DomText are returned too. Here is the input file "get_elements_by_tagname.xml" used for the test: <section> <text> <lang code="default">Hardware clock set to UTC</lang> <lang code="fr">Horloge BIOS est UTC</lang> </text> <widget type="checkbox"> <default>off</default> </widget> </section> Reproduce code: --------------- <?php $filename="get_elements_by_tagname.xml"; if(!$dom = domxml_open_file($filename)) { print "Could not open $filename"; return; } $root=$dom->document_element(); $textnodes=$root->get_elements_by_tagname("text"); print "<pre>\n"; print_r($textnodes); print "</pre>\n"; ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28188&edit=1