Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting started with XML
Message
From
17/12/2011 06:06:42
 
 
To
16/12/2011 11:37:11
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01531198
Message ID:
01531251
Views:
58
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform