wwxml::DataSetXMLToCursor

Imports data from an XML Dataset into a Fox cursor. As of now the cursor must be pre-created and you must specify which cursor you want to import from the dataset if multiple cursors are contained within it.

o.DataSetXMLToCursor(lvXML,lcAlias, lcDataSetTable)

Return Value

.T. or .F.

Parameters

lvXML
An XML string or XMLDOM document

lcAlias
The Alias of the open cursor that the data will be read into. This cursor must exist and have the structure you want to be filled.

lcDataSetTable
Optional - Name of the table from the dataset to import. Required if the dataset contains more than a single table. This value is case sensitive!

Remarks

To create a DataSet from VFP data you can simply export a file with either VFP's CURSORTOXML or using Web Connection's wwXML::CursorToXML. .Net will be able to pick up the raw table data and turn into a .Net dataset for you.

Example

CLEAR
DO WCONNECT


oXML = CREATEOBJECT("wwXML")

*** Retrieve a dataset with Authors and Employees from Pubs
lcXML = LoadUrl("http://rasnote2/CodeWebService.asmx/" + ;
                "GetAuthorAndEmployeeData?lcID=")

*** Pre-create the cursor
CREATE CURSOR TAuthors ;
(    AU_ID       C (11),;
   AU_LNAME    C (40),;
   AU_FNAME    C (20),;
   PHONE       C (12),;
   ADDRESS     C (40),;
   CITY        C (20),;
   STATE       C (2),;
   ZIP         C (5),;
   CONTRACT    L )
   
? oXML.DataSetXMLToCursor(lcXML,"TAuthors","Authors")

*** Pre-Create the Author cursor
SELECT 0
CREATE CURSOR TEmployees ;
(    EMP_ID      C (9),;
   FNAME       C (20),;
   MINIT       C (1),;
   LNAME       C (30),;
   JOB_ID      I ,;
   JOB_LVL     I ,;
   PUB_ID      C (4),;
   HIRE_DATE   T )

? oXML.DataSetXMLToCursor(lcXML,"TEmployees","Employees")

BROWSE NOWAIT

SELE TAuthors
BROWSE NOWAIT

See also:

Class wwXML (High Level Methods)

© West Wind Technologies, 2023 • Updated: 04/02/02
Comment or report problem with topic