VBScript: XPath Query with multiple namespaces -


XPath query i GetLogisticsOfferDateResult node? I have added that VBSPT which I am using. I doubt that the problem with multiple namespaces in the document but I How should I refer to another namespace in XPath?

  dim response XML response XML = ' "& lt; s: Envelope xmlns: s =" "http://schemas.xmlsoap.org/soap / envelope /" "& gt; & lt; s: Body & gt; & lt; GetLogisticsOfferDateResponse xmlns = "" http://schneider-electric.com/OrderEntryService "" gt; & lt; GetLogisticsOfferDateResult & gt; 2010-07-20 & lt; / GetLogisticsOfferDateResult & gt ; & lt; / GetLogisticsOfferDateResponse & gt; & lt; / s: Body & gt; & lt; / s: envelope & gt; "slow response Dock set response Dock = WScript.CreateObject (" MSXML2.DOMDocument.6.0 ") response .Doc.loadXML (responseXML) responseDoc.setProperty "SelectionNamespaces", "Xmlns: s = 'http: //schemas.xmlsoap.org/soap/envelope/'" dim requested node this node does not have "set a Requested Node = ResponseDoc SelectSynongNode ("// s: Envelope // S: Body // GetLogisticsOfferDateResponse // GetLogisticsOfferDateResult") 'This node has been set to set Node = responseDoc.selectSingleNode ("// s: envelope // s: body") 'This node is found' set requestNode = ResponseDoc. Select the syndication ("// s: envelope") if the requested node is nothing then WScript.Echo "node was not found" or WScript.Echo requested Node.text End if set Dock Response = nothing set LodateNode = None  

Turns on setting my selection of namespaces as follows Was:

  responseDoc.setProperty "SelectionName", "Xmlns: sc = 'http: //schneider-electric.com/OrderEntryService' xmlns: s = 'http: //schemas.xmlsoap. Org / soap / envelope / '" 

Then the XPath query is Was not:

  set requested node = response dock .selectSingleNode ("// s: envelope // s: body // sc: GetLogisticsOfferDateResponse // sc: GetLogisticsOfferDateResult")  < / Pre> 

Comments