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
)