Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xml posting (newbie)
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00856000
Message ID:
00856154
Vues:
26
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<
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform