Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to parse this XML through DOM?
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01271219
Message ID:
01271227
Views:
20
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform