php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39268 SimpleXML doesn't parse attributes with : inside
Submitted: 2006-10-26 16:34 UTC Modified: 2006-10-26 18:25 UTC
From: luca dot casagrande at gmail dot com Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.1.6 OS: Linux
Private report: No CVE-ID: None
 [2006-10-26 16:34 UTC] luca dot casagrande at gmail dot com
Description:
------------
Hi!
I am trying to parse an xml with simplexml;

This is the XML file:
<ExecuteResponse version="0.4.0" xsi:schemaLocation="http://www.opengeospatial.net/wps http://www.bnhelp.cz/schema/wps/0.4.0/wpsExecute.xsd">
<ows:Identifier>
		visibility2
	</ows:Identifier>
&#8722;
	<Status>
<ProcessSucceeded/>
</Status>
&#8722;
	<ProcessOutputs>
&#8722;
	<Output>
<ows:Identifier>
				output
			</ows:Identifier>
<ows:Title>
				Resulting output map
			</ows:Title>
<!--Element Abstract not set-->
<ComplexValueReference encoding="utf-8" format="image/png" ows:reference="http://localhost/wps/wpsoutputs/output-2006-10-26-17-53-42.tif" schema=""/>
</Output>
</ProcessOutputs>
</ExecuteResponse

This is the dump of the xml obj:

object(SimpleXMLElement)#1 (3) {
  ["@attributes"]=>
  array(1) {
    ["version"]=>
    string(5) "0.4.0"
  }
  ["Status"]=>
  object(SimpleXMLElement)#3 (1) {
    ["ProcessSucceeded"]=>
    object(SimpleXMLElement)#2 (0) {
    }
  }
  ["ProcessOutputs"]=>
  object(SimpleXMLElement)#4 (1) {
    ["Output"]=>
    object(SimpleXMLElement)#5 (2) {
      ["comment"]=>
      object(SimpleXMLElement)#6 (0) {
      }
      ["ComplexValueReference"]=>
      object(SimpleXMLElement)#7 (1) {
        ["@attributes"]=>
        array(3) {
          ["encoding"]=>
          string(5) "utf-8"
          ["format"]=>
          string(9) "image/png"
          ["schema"]=>
          string(0) ""
        }
      }
    }
  }
}

As you can see, ows:reference attribute, is skipped.

Thx
Luca


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-26 18:25 UTC] helly@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

Try 5.2 and use the namespace parameters of the access functions. In 5.1 you need to register the namespace you want to access. Try that as well, it should solve your problem immediatley if you know the namespaces.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC