Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursortoxml and xmltocursor
Message
From
21/06/2010 07:02:31
 
 
To
18/06/2010 01:25:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01469554
Message ID:
01469851
Views:
64
SELECT * FROM awards into cursor query
CURSORTOXML('query',"xx1.xml",1,0,0,"1")

you need the "1" at the end to create a schema. without the schema VFP woild not know the types of the fields.


Peter





>Hi Guys,
>
>I want to create a program that will convert a cursor into an xml file and later use that xml file to retrieve the data stored in it. I created the following cursor
>
>CREATE CURSOR mycur (pono c(10), order I(4))
>
>I then populated this cursor with the following records
>
>1000 0
>1001 1
>1002 1
>
>I then converted this cursor to xml using the following lines of code
>
>CURSORTOXML("mycur","lcXML",1,48)
>STRTOFILE(lcXML,"c:\mycur1.xml")
>
>when its time for me to use the xml file and convert it back into a cursor I used the following lines of code
>XMLTOCURSOR("c:\mycur1.xml","newcur",4)
>
>The main problem is that the data type for the field pono has changed to Integer and the field for order has changed to L(1) or logical. Is there a way to retain the original field types of the original cursor which in this case is mycur? I am expecting that when I convert the xml file back to cursor using this line of code, XMLTOCURSOR("c:\mycur1.xml","newcur",4) it will create a new cursor with an alias of newcur having the same fields and data type as mycur.
>
>Please help and thanks in advance...
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform