Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php simplexml_load_string()只加载第一个属性_Php_Xml_Simplexml_Xml Deserialization - Fatal编程技术网

Php simplexml_load_string()只加载第一个属性

Php simplexml_load_string()只加载第一个属性,php,xml,simplexml,xml-deserialization,Php,Xml,Simplexml,Xml Deserialization,我遇到了一个问题,simplexml\u load\u string()只返回第一个属性。 输入如下: <xsl:stylesheet version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wsdl="http://sche

我遇到了一个问题,
simplexml\u load\u string()
只返回第一个属性。 输入如下:

<xsl:stylesheet version="1.0"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:res="{REQUEST_URI}"
                xmlns:php="http://php.net/xsl"
    >
  <xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified"
             version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN"
             xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
    <blabla>
          <foo>uiop</foo>
          <bar>qwerty</bar>
    </blabla>
  </xs:schema>
</xsl:stylesheet>

但我需要对整个文档进行解析。

您能给我们看一下输入文档和生成该输出的代码吗?@joadha output由IDE Eclipse显示。代码:“$xml=simplexml_load_string($xmlSource);”。输入文档有点私密。但是没有什么特别的,所以我更新了我的问题。问题是其余的属性都是命名空间的。请阅读以下内容:
[@attributes] => Array
                (
                    [Version] => 1.0
                )