opticalman
Programmer
I am new to XML
I am using VFP8.
I am looking into sending orders to a vendor via XML.
My vendor has supplied me a sample of an XML file that he receives from other customers.
I can successfully generate a XML file from a local cursor via the CURSORTOXML() function. I can then regenerate a cursor from the created XML file via the XMLTOCURSOR() function. My problem is when I try to generate a cursor from the sample XML file from my vendor. Using the same XMLTOCURSOR() function yields a cursor/table with less that half of the expected columns and no data in the fields.
I have also tried the XMLadapter via the command box, by entering the commands suggested in VFP help, but I receive an error.
My question is: are there other ways to parse a XML files to generate a cursor?
Jim Rumbaugh
I am using VFP8.
I am looking into sending orders to a vendor via XML.
My vendor has supplied me a sample of an XML file that he receives from other customers.
I can successfully generate a XML file from a local cursor via the CURSORTOXML() function. I can then regenerate a cursor from the created XML file via the XMLTOCURSOR() function. My problem is when I try to generate a cursor from the sample XML file from my vendor. Using the same XMLTOCURSOR() function yields a cursor/table with less that half of the expected columns and no data in the fields.
I have also tried the XMLadapter via the command box, by entering the commands suggested in VFP help, but I receive an error.
Code:
oXMLAdapter = NEWOBJECT('XMLAdapter')
cFile = GETFILE() && select sample XML
cXml = FILETOSTR( cFile ) && load to string
MESSAGEBOX( oXMLadapter.LoadXML(cXML) )
&& load is confirmed by .T.
MESSAGEBOX(;
oXMLAdapter.Tables.Item(1).Fields.Item(1).DataType )
&&(Error 2061) Index or expression does not
&& match an existing member of the collection.
Jim Rumbaugh