php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26963 get_elements_by_tagnem
Submitted: 2004-01-19 05:09 UTC Modified: 2004-01-19 13:22 UTC
From: gab dot s at freemail dot hu Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.4 OS: Debian Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gab dot s at freemail dot hu
New email:
PHP Version: OS:

 

 [2004-01-19 05:09 UTC] gab dot s at freemail dot hu
Description:
------------
OS: Debian, Linux kernel 2.4.18-bf2.4
Version: 4.3.4
libxml Version: 20506  

I have used the dom xml extension for a year, and
i have a piece of code where a find for nodes in an xml document.
It works with 4.3.2-rc2 and 4.3.2, but does not works with 4.3.4.

<?php
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Application>
	<first>
		data
	</first>
	<second>
		data2
	</second>
</Application>";

$xmldoc = domxml_open_mem($xml);

$root = $xmldoc->document_element();

$nodearray = $xmldoc->get_elements_by_tagname("/Application");

print_r($nodearray);

?>


On php version 4.3.2-rc2 and 4.3.2:

Expected result:

Array ( [0] => domelement Object ( [type] => 1 [tagname] => Application [0] => 3 [1] => 135422608 ) ) 

Actual result:

Array ( [0] => domelement Object ( [type] => 1 [tagname] => Application [0] => 3 [1] => 135422608 ) ) 



On php version 4.3.4

Expected result:

Array ( [0] => domelement Object ( [type] => 1 [tagname] => Application [0] => 3 [1] => 135422608 ) ) 

Actual result:

Array ( ) 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-19 13:22 UTC] sniper@php.net
$nodearray = $xmldoc->get_elements_by_tagname("/Application");

Change to:

$nodearray = $xmldoc->get_elements_by_tagname("Application");
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 20:01:30 2025 UTC