Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parse XML in VFP possibly using xpath
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Parse XML in VFP possibly using xpath
Divers
Thread ID:
00691656
Message ID:
00691656
Vues:
73
I have some XML similar to the sample below. I would like to parse it and place it into two VFP cursors, CurCustomer and CurInvoices. Currently I am parsing the XML with code something like:
WITH loXMLDOM.DocumentElement.ChildNodes
FOR iCount = 0 TO .LENGTH - 1
*APPEND BLANK
FOR iChild = 0 TO .ITEM(iCount).ChildNodes.LENGTH - 1
lcVar = .ITEM(iCount).ChildNodes(iChild)

I am looking for a VFP code sample showing a "better" [best practice] method, possibly using XPATH, to accomplish my objective.

<MYDataSet>
<arcust>
<ccustno>4045 </ccustno>
<ccompany>MY MOTOR SPORTS, INC. </ccompany>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 37466</cinvno>
</arinvc>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 37946</cinvno>
</arinvc>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 39226</cinvno>
</arinvc>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 39482</cinvno>
</arinvc>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 40302</cinvno>
</arinvc>
<arinvc>
<ccustno>4045 </ccustno>
<cinvno> 40727</cinvno>
</arinvc>
</arcust>
<arcust>
<ccustno>4049 </ccustno>
<ccompany>ZZZ AUTO SERVICE </ccompany>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 37276</cinvno>
</arinvc>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 38184</cinvno>
</arinvc>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 38929</cinvno>
</arinvc>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 40117</cinvno>
</arinvc>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 41486</cinvno>
</arinvc>
<arinvc>
<ccustno>4049 </ccustno>
<cinvno> 42820</cinvno>
</arinvc>
</arcust>
</MYDataSet>

TYIA,
Robert - Zxytek
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform