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<
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement