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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Thu Feb 27 09:01:26 2020 UTC