I am making some progress I think.
I have used the microsoft tool xsd.exe against the sample xml file I have been sent and generated an xsd schema file. And then used the following code to generate tables from the xml file:
oXA = CREATEOBJECT("XmlAdapter")
oXA.xmlschemalocation = "c:\temp\sampleorder.xsd"
oXA.RespectNesting = .T.
oXA.LoadXML("C:\temp\sampleorder.xml",.T.)
FOR i=1 TO oXA.Tables.Count
oXA.Tables(i).Tocursor()
ENDFOR
SET
But it is generating the error: "XML object does not have associated fields"
I am not entirely convinced the sampleorder.xml file I have is correctly formatted. I would be happy to email the file to anyone who thinks they can help if it would help track down the problem.
Any help greatly appreciated.
Barry Sutton.
>I am trying to get to grips with importing XML data into VFP. I have had a dabble with the XMLADAPTER and XMLTOCURSOR but am not quite "getting there".
>
>I have to handle a nested XML file (Order>Items) - one xml file per order. But I do not have a Schema. How do I go about importing the xml file without a Schema? Or is there a way I can build a standalone schema and then use this against the xml files I am being sent?
>
>I would be happy to email the sample xml file I have been sent if it would help as there are a couple of aspects about the hierarchy of it which I do not fully understand in any case.
>
>Sorry to be so dim on this - any help grately appreciated.
>
>Barry Sutton