0
我在使用DOMDocument PHP查找WSDL(XML)文檔上的某個節點時遇到問題。當我使用getElementsByTagName時,它總是返回NULL。我要找到的是xsd:complexType,但是當我嘗試不同的節點時,讓我們說類型,它返回一個對象。在DOM上使用PHP查找(XML)節點
這是我的WSDL(XML)文檔
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:routeDx2" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:routeDx2">
<types>
<xsd:schema targetNamespace="urn:routeDx2"
>
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
<xsd:complexType name="inputCashin">
<xsd:all>
<xsd:element name="userName" type="xsd:string"/>
<xsd:element name="signature" type="xsd:string"/>
<xsd:element name="productCode" type="xsd:string"/>
<xsd:element name="merchantCode" type="xsd:string"/>
<xsd:element name="terminal" type="xsd:string"/>
<xsd:element name="merchantNumber" type="xsd:string"/>
<xsd:element name="transactionType" type="xsd:string"/>
<xsd:element name="recipientNumber" type="xsd:string"/>
<xsd:element name="recipientName" type="xsd:string"/>
<xsd:element name="amount" type="xsd:string"/>
<xsd:element name="feeAmount" type="xsd:string"/>
<xsd:element name="traxId" type="xsd:string"/>
<xsd:element name="timeStamp" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="inputCashout">
<xsd:all>
<xsd:element name="userName" type="xsd:string"/>
<xsd:element name="signature" type="xsd:string"/>
<xsd:element name="productCode" type="xsd:string"/>
<xsd:element name="merchantCode" type="xsd:string"/>
<xsd:element name="terminal" type="xsd:string"/>
<xsd:element name="merchantNumber" type="xsd:string"/>
<xsd:element name="transactionType" type="xsd:string"/>
<xsd:element name="recipientNumber" type="xsd:string"/>
<xsd:element name="recipientName" type="xsd:string"/>
<xsd:element name="amount" type="xsd:string"/>
<xsd:element name="feeAmount" type="xsd:string"/>
<xsd:element name="verifyingCode" type="xsd:string"/>
<xsd:element name="traxId" type="xsd:string"/>
<xsd:element name="timeStamp" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<definitions>
什麼,我要找到的是XSD:複雜類型,或者如果可能的話,如何由具有獨特的價值屬性名稱查找(verifyingCode或其他人) ,我該如何通過PHP和DOMDocument完成這項工作?
我包括我的查詢XSD命名空間,這是作品。謝謝 :) –