Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLTOCURSOR() FUNCTION

Status
Not open for further replies.

Fleer

Programmer
Mar 8, 2001
11
0
0
BE
Hi experts,

In VFP7 there's a function to convert a XML file to a cursor or table, can someone explain me how this is to be done. If possible with an example.

I checked the help about this function but can't figure out how it works.

Thanks
Fleer
 
Fleer,

You can use this is two ways.

To convert a memory variable, memo field or return from an HTTP request:-

XMLToCursor("MyVariable", "MyCursor")

OR by converting a file:-

XMLToCursor("Results.xml","MyCursor")

I would have thought you could test this out by creating a small VFP table or cursor, running CursorToXML on it and then running XMLToCursor to get it back.

Hope that helps,

Stewart
 
XMLTOCURSOR
XMLTOCURSOR(XMLSource eExpression | cXMLFile [, cCursorName [, nFlags ]])

XMLTOCURSOR("c:\customer.xml","Ccustomer_Queue_Log",512)

The flag number is important at the end and in this case a DTD is included with the XML file that describes the data in the XML file. One thing to note is if there is no data in the XML file it will crash VFP 7. (In other words there is only some header information in the XML file but not data.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top