Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing non-table xml
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Divers
Thread ID:
01422447
Message ID:
01422465
Vues:
74
It's easy to parse it with XmlDOM
lcXmlFIle = FULLPATH("temp.xml")

loXmlDoc = CreateObject("Msxml2.DOMDocument.3.0")		&& MSXML 3.0, used by Xmltocursor()

* Turn some switches off
loXmlDoc.validateOnParse = .F.
loXmlDoc.async  = .F.
loXmlDoc.resolveExternals  = .F.
* 	and On
loXmlDoc.preserveWhiteSpace = .T.

* Load the xml document
= loXmlDoc.Load(lcXmlFile)

* Check for errors
If loXmlDoc.parseError.errorCode <> 0
   ?loXmlDoc.parseError.reason
   RETURN .F.
ENDIF

loItem = loXmlDoc.selectSingleNode("//TimeTrackingAddRs")
? loItem.getAttribute("statusCode"), loItem.getAttribute("statusSeverity"), loItem.getAttribute("statusMessage")
>I am working with Quickbooks XML integration, and I have a question about parsing a response. Here is an example of a response I am getting when an operation fails:
>
>
><?xml version="1.0" ?>
><QBXML>
>  <QBXMLMsgsRs>
>    <TimeTrackingAddRs statusCode="3310" statusSeverity="Error" statusMessage="... explanation of the error ...." />
>  </QBXMLMsgsRs>
></QBXML>
>
>
>Is there a way to parse this using XMLAdapter or some other tool, or do I just have to do it manually?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform