Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need some XML parsing help
Message
De
28/03/2005 08:03:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00999113
Message ID:
00999396
Vues:
20
This is the code which will save my bacon. I do appreciate you expanding on Rick's sugestion for XPATH. You guys are the "Bomb"

Glenn
>Glenn,
>
>I have had some struggles with this recently as well. Rick's suggestion of XPATH is correct, but it can really be painful at first. Try this as a sample:
>
>
>loXml = NEWOBJECT("MSXML2.DomDocument")
>loXml.async = .F.
>IF loXml.load("x.xml")
>    * pulling the price from the 'c' section in your example
>    lcPrice = loXml.documentElement.selectSingleNode("//datafield[@tag='260']/subfield[@code='c']").text
>ENDIF
>
>
>There are extra things you need to check for to make it robust, i.e. that selectSingleNode returned an object, that the object has elements. Where most people get stuck is not realising they can nest the query information.
>
>HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform