Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Xml posting (newbie)
Message
 
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00856000
Message ID:
00856154
Views:
27
This message has been marked as the solution to the initial question of the thread.
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
Map
View

Click here to load this message in the networking platform