php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55171 XML tags are meant to be case sensitive - but PHP displays them in all caps
Submitted: 2011-07-10 16:33 UTC Modified: 2011-07-11 12:54 UTC
From: xryuku at hotmail dot co dot uk Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 5.3.6 OS:
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: xryuku at hotmail dot co dot uk
New email:
PHP Version: OS:

 

 [2011-07-10 16:33 UTC] xryuku at hotmail dot co dot uk
Description:
------------
---
From manual page: http://www.php.net/book.xml
---

When using xml_parse_into_struct(), the [tag] value of each array is in all caps, 
when XML is meant to be case sensitive, as noted here:
http://www.w3schools.com/xml/xml_syntax.asp

Therefore, tags should be the same in PHP as they are in the XML.

Test script:
---------------
<?php

XML_Parse_Into_Struct(XML_Parser_Create(), File_Get_Contents('XML/Home.xml'), $XML);


Print_R($XML);

Expected result:
----------------
Array
(
    [0] => Array
        (
            [tag] => Trezu
            [type] => open
            [level] => 1
            [value] => 
	
        )
 
    [1] => Array
        (
            [tag] => Title
            [type] => complete
            [level] => 2
            [value] => Trezu
        )
 
    [2] => Array
        (
            [tag] => Trezu
            [value] => 
	
            [type] => cdata
            [level] => 1
        )
 
    [3] => Array
        (
            [tag] => Content
            [type] => complete
            [level] => 2
            [value] => 
				*content here* 
	
        )
 
    [4] => Array
        (
            [tag] => Trezu
            [value] => 
 
            [type] => cdata
            [level] => 1
        )
 
    [5] => Array
        (
            [tag] => Trezu
            [type] => close
            [level] => 1
        )
 
)

Actual result:
--------------
Array
(
    [0] => Array
        (
            [tag] => TREZU
            [type] => open
            [level] => 1
            [value] => 
	
        )
 
    [1] => Array
        (
            [tag] => TITLE
            [type] => complete
            [level] => 2
            [value] => Trezu
        )
 
    [2] => Array
        (
            [tag] => TREZU
            [value] => 
	
            [type] => cdata
            [level] => 1
        )
 
    [3] => Array
        (
            [tag] => CONTENT
            [type] => complete
            [level] => 2
            [value] => 
				*content here* 
	
        )
 
    [4] => Array
        (
            [tag] => TREZU
            [value] => 
 
            [type] => cdata
            [level] => 1
        )
 
    [5] => Array
        (
            [tag] => TREZU
            [type] => close
            [level] => 1
        )
 
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-11 12:54 UTC] iliaa@php.net
-Status: Open +Status: Bogus
 [2011-07-11 12:54 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is function of libxml not PHP.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 11:05:56 2022 UTC