2011-06-01 68 views
0

這裏是responde XML我得到:我怎麼能知道,如果一個節點exsits或不

<?xml version="1.0" ?> 
- <SOAP-ENV:Envelope 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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:ws.paymentech.net/PaymentechGateway"> 
- <SOAP-ENV:Body id="_0"> 
- <SOAP-ENV:Fault> 
    <faultcode>SOAP-ENV:Server</faultcode> 
    <faultstring>521 Error. The Orbital Gateway has received a badly formatted message. Field [Card Number] exceeded max length of [19]</faultstring> 
    </SOAP-ENV:Fault> 
    </SOAP-ENV:Body> 
    </SOAP-ENV:Envelope> 

我得到這樣的:

Response.write oXmlHTTP.responseXML.xml 

我曾嘗試

if myXML.selectSingleNode("faultcode") Is Nothing then 

if not isObject(myXML.selectSingleNode("faultcode")) then 

兩個2情況下XML有這個節點,即使是真的也沒有它

我究竟做錯了什麼?

回答

0

做的兩個步驟

Set faultCodeNode = myXML.selectSingleNode("faultcode") 

If faultCodeNode Is Nothing Then 
+0

我會嘗試,但就是有2步的區別? – 2011-06-02 03:16:11

+0

不適合我 – 2011-06-02 04:51:37

相關問題