Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML Parsing error
Message
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00658658
Message ID:
00658774
Views:
31
Jaime,

I'm pretty sure that XMLToCursor() can not properly deal with your hierarchical document. Your elements pick_up, drop_off and additional_options are all composed of elements then you don't have a flat cursor. One reason is that these might be multiply occuring elements.

If you have control of the DTD that governs this and the three elements do not have multiple values you could flatten this part of your hierarchy out of the XML.

If you can't or don't want to remove the hierarchy, you could process it as 4 documents, after pulling out the three subdocuments using strextract().

You can also use the XMLDOM to give you node by node access to the document.

Any of the above options are better than wrigint your own XML parser. Composing XML documents is easy, reading them is a lot tougher.

>I get a zillion parser errors when trying to run xmltocursor on the following xml code:
><?xml version="1.0" encoding="Windows-1255"?>
><order>
>	<country>51</country>
>	<pick_up>
>		<pick_up_location>London</pick_up_location>
>		<pick_up_date>17/5/2002</pick_up_date>
>		<pick_up_time>0:00</pick_up_time>
>	</pick_up>
>	<drop_off>
>		<drop_off_location>003</drop_off_location>
>		<drop_off_date>20/5/2002</drop_off_date>
>		<drop_off_time>0:00</drop_off_time>
>	</drop_off>
>	<driver_age>25-70</driver_age>
>	<rate>102</rate>
>	<totalDays>3</totalDays>
>	<carDesc>GROUP B,BMW 1800,0,1,Israel</carDesc>
>	<prebookable/>
>	<additional_options>
>		<other_countries/>
>		<cdw_gold/>
>		<baby/>
>		<child/>
>		<ski/>
>		<snow/>
>	</additional_options>
>	<confirmed/>
></order>
>
>
>Shoud i do some manual parsing instead of the xmltocursor command?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform