Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML to cursor
Message
From
18/02/2003 10:10:27
 
 
To
18/02/2003 08:47:21
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Miscellaneous
Thread ID:
00754418
Message ID:
00754464
Views:
16
>Has anyone ever needed to create a cursor or retrieve data from an xml files where the schema is not known - i.e. xmltocursor won't do the trick?
>
>I've been playing with my own class but I wondered if there was anything out there that has already been written.
>
>Thanks for your help in advance.

Hello

Yes, I have worked with it a lot.

If you don't have a schema, XMLTOCURSOR tries to figure out the data structure, and makes a cursor which sometimes is correct, sometimes not. For instance if you have a numeric value which is only 0 or 1, xmltocursor will think it is a logical field, which 'bit me' a couple of times.

If you know the data structure of the xml-file, the best is to create a cursor with the correct structure. The following lines is taken from a program I have made which accepts orders via XML:

create cursor xmlorder (........)
lnXmlRecords=XMLTOCURSOR(lcFilename + '.xml','xmlorder',512+8192)

lnXMLRecords will contain the number of records
8192 tells xmltocursor to fill the data into the cursor xmlorder.

In my system the orders come as single xml-files with both the order header and the line items in the sale file. I then have a simple SCAN-routine to retrieve the data I want.
Previous
Reply
Map
View

Click here to load this message in the networking platform