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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 07:01:29 2024 UTC