Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLAdapter - parent/child cursors to XML
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
01065268
Message ID:
01065333
Vues:
26
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I am trying to use XMLAdapter to create an XML document describing two cursors having a parent/child relationship. The cursors are generated and the relationship established prior to using the XMLAdapter class.
>
>I use AddTableSchema to add each cursor, then call ToXML. The output is created without error, but analyzing the XML document seems to show two flat cursors, and no relationship existing obviously between then. The VFP Help file topic for AddTableSchema seems to say that table relationships are stored.
>
>Am I doing this correctly? What am I missing?

Hi John,

Did you set RespectNesting=.T. ? Try
CLOSE DATABASES 
OPEN DATABASE (HOME(2)) + "Northwind\northwind.dbc"
SELECT 0
USE northwind!OrderDetails 
SET ORDER TO ORDERID   && ORDERID
SELECT 0
USE northwind!Orders 
SET RELATION TO OrderID INTO OrderDetails
oXA = CREATEOBJECT("XmlAdapter")
oXA.RespectNesting = .T.
oXA.AddTableSchema("Orders")
oXA.AddTableSchema("OrderDetails")
oXA.ToXML("Orders.xml",,.T.)
Modify Command Orders.xml Nowait
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform