Bug #51235 [Opn->Fbk]: getElementsByTagName always return an empty list
| From: | rrichards@php.net | Date: | Mon, 08 Mar 2010 13:01:53 +0000 |
| Subject: | Bug #51235 [Opn->Fbk]: getElementsByTagName always return an empty list | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-148395@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51235&edit=1
ID: 51235
Updated by: rrichards@php.net
Reported by: marsala dot marco at fastwebnet dot it
Summary: getElementsByTagName always return an empty list
-Status: Open
+Status: Feedback
Type: Bug
Package: DOM XML related
PHP Version: 5.3.2
New Comment:
You sure no errors or warnings being thrown that aren't being shown? The
example
works fine for me using 5.3.2 and latests libxml2.
Previous Comments:
------------------------------------------------------------------------
[2010-03-08 13:27:47] marsala dot marco at fastwebnet dot it
Description:
------------
$document = new DOMDocument()->load(...);
$document->getElementsByTagName(<root element name>) works (returns list
with one element).
getElementsByTagName(<non root element name>) always return an empty
list. Examples on notes and on the web (some examples claimed to be
working are prior the 5.3.2) are all not working.
Tested on LAMP server PHP 5.2.8 AND on XAMPPLite WAMP PHP 5.3.1, both
not working.
Test script:
---------------
$doc = new DOMDocument();
$doc->load('__xml/faq.xml');
$faqs = $doc->getElementsByTagName("faq");
echo $faqs->length; // always 0
__xml/faq.xml is:
<?xml version="1.0" encoding="iso-8859-1"?>
<faqs>
<faq>
<domanda>domanda1</domanda>
<risposta>risposta1</risposta>
</faq>
<faq>
<domanda>domanda2</domanda>
<risposta>risposta2</risposta>
</faq>
<faq>
<domanda>domanda3</domanda>
<risposta>risposta3</risposta>
</faq>
</faqs>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51235&edit=1