Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XML to DBF
Message
From
06/10/2003 11:20:34
 
 
To
06/10/2003 08:23:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00835317
Message ID:
00835395
Views:
12
Hi Ron.

Does anybody know a way to convert an XML databasefile into a Visual FxPro table? (Nomatter what the structure of the XML file is).

I am not sure what you mean by "no matter what the structure of the XML is < s >. Of course, in VFP 7, there is CURSORTOXML(), but the structure of the XML matters. In VFP 8, you can use the XmlAdapter class.

If you want to convert hierarchical XML to multiple related cursors, we have a class in Chapter 17 of MegaFox: 1002 Things You Wanted to Know About Extending VFP that does this:

How do I data-drive the production of XML?( Example: GenerateXml.scx and ExportXML.prg::ExportXML )

As noted above, one of the limitations to using the XMLTOCURSOR() function is that it cannot be used to represent complex relationships between multiple cursors in a single document. Another problem is that when the structure of a cursor changes, so does the generated XML. Fortunately, since we are using Visual FoxPro, it is possible to create a data-driven class that gives us the flexibility we require. However, you should be aware that our sample classes do not account for every single type of node that could be contained in an XML document, nor do they handle DTDs or Schemas. They are intended to show how an XML handling class can be constructed to meet your specific needs.

We designed our metadata to handle the creation of XML from specified cursors as well as the creation of these cursors from an XML document. This metadata is contained in two separate tables. The first one, XMLCURSORS.DBF, holds information about the cursors from which the XML is generated or into which XML is to be imported. Its structure is shown in Table 17.1.
Previous
Reply
Map
View

Click here to load this message in the networking platform