Well, the sample you provided wasn't well formed XML. But assuming that it normally is, sure there's a better way.
You already have a DOM object:
objXmlDOM = createobject("MSXML2.DOMDOCUMENT")
... so now you want to load the return value of the request into the DOM, is that it?
objXmlDOM.LoadXML(objHttp.responseText)
First thing I would do is error check, incidentally... and you should also check that the response you got was well-formed (check LEN(objXmlDOM.xml) or objXMLDOM.parseError.Reason).
... but let's assume that things have gone as planned... now you want customer ID and status. If it's a short document, and if you know there's only/exactly one Status node, you can just do this:
? objXmlDOM.selectSingleNode("//Status").text
... and the same for the CustomerID.
You're better off, as a general practice, drilling down explicitly to the status node you want, and also error checking, though:
loNode = ox.selectSingleNode("/TransactionBatch/ACHTransaction/Sale/Status")
IF VARTYPE(loNode) = "O"
cStatus = loNode.text
ENDIF
... HTH,
>L<
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only