Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to produce xml with 2 tables ?
Message
From
06/04/2006 10:13:41
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01110976
Message ID:
01110985
Views:
19
I have 2 tables: clients & sites
I need to produce an xml file like that:


As Sergey says, you cannot do this with CURSORTOXML(). I am pretty dure that you can do this with an Xml adapter if you upgrade to version 9.0.

If you must stay with 8.0, we have a class in Chapter 17 of MegaFox: 1002 Things You Wanted to Know About Extending VFP that will let you accomplish this:

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.
Previous
Reply
Map
View

Click here to load this message in the networking platform