Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to parse this XML through DOM?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01271219
Message ID:
01271227
Vues:
19
Jaime,

If you preproces XML and remove 'serviceResponse ' tag, you can use XMLTOCURSOR()
TEXT TO lcXml NOSHOW
<?xml version="1.0"?>
   <cityList>
    <city cityCode="CITY1" cityDescription="CITY1 DESC"/>
    <city cityCode="CITY2" cityDescription="CITY2 DESC"/>
    <city cityCode="CITY3" cityDescription="CITY3 DESC"/>
    <city cityCode="CITY4" cityDescription="CITY4 DESC"/>
   </cityList>
ENDTEXT

= XMLTOCURSOR(lcXml, "crsXml")
>I currently receive xml data from a web service, as follows:
><?xml version="1.0"?>
> <serviceResponse returnCode="OK">
>   <cityList>
>    <city cityCode="CITY1" cityDescription="CITY1 DESC"/>
>    <city cityCode="CITY2" cityDescription="CITY2 DESC"/>
>    <city cityCode="CITY3" cityDescription="CITY3 DESC"/>
>    <city cityCode="CITY4" cityDescription="CITY4 DESC"/>
>   </cityList>
> </serviceResponse>
>Anyway to rapidly enter this data into my table ( 2 fields, citycode and citydesc respectively )?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform