php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62448 XML ID attribute not parsed correctly, overriding the ID node value in the XML
Submitted: 2012-06-29 11:34 UTC Modified: -
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: danny dot dorfel at gmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: Irrelevant OS: Linux / CentOS
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: danny dot dorfel at gmail dot com
New email:
PHP Version: OS:

 

 [2012-06-29 11:34 UTC] danny dot dorfel at gmail dot com
Description:
------------
The XML returned has an Id node and an Id attribute. The parsed response creates 
an object and fills the Id value with the value of the Id attribute. De node's 
value is not used.

ID and IDREF attributes are predefined SOAP attributes and don't need to be 
parsed. Unfortunately .net soap services return the ID as z:Id, resulting in a 
parse.

Response XML:
<Person z:ID="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
...
<Id>94acdd8b-2ae5-448a-9a61-d2df5218111e</Id>
...
</Person>

For me, preferred end result would be that we have the value of the node in Id 
and the value of the attribute in _Id or something like _attrib['Id'].

Expected result:
----------------
stdClass Object
(
    [Person] => stdClass Object
        (
...
            [Id] => 94acdd8b-2ae5-448a-9a61-d2df5218111e
...
        )
)

Actual result:
--------------
stdClass Object
(
    [Person] => stdClass Object
        (
...
            [Id] => i1
...
        )
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 28 23:01:28 2020 UTC