我无法理解为什么我无法从这样的XML中提取所有名称空间属性:
<MapData
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:semi-org:xsd.E142-1.V0211.SubstrateMap"
xmlns:sme="urn:st-com:xsd.E142-1.V0211.SubstrateMap-STmicroelectronics-V1015"
xsi:schemaLocation="urn:semi-org:xsd.E142-1.V0211.SubstrateMap E142-1-V0211.SubstrateMap-ST-V1015.xsd"
>
(...)
</MapData>
然后用
$xml = new SimpleXMLElement();
$xml->getNamespaces();
我获得了
Array
(
[xsi] => http://www.w3.org/2001/XMLSchema-instance
[] => urn:semi-org:xsd.E142-1.V0211.SubstrateMap
[sme] => urn:st-com:xsd.E142-1.V0211.SubstrateMap-STmicroelectronics-V1015
)
但为什么不返回xsi:schemaLocation
的值?