Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLAdapter Problems
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Titre:
XMLAdapter Problems
Divers
Thread ID:
01259571
Message ID:
01259571
Vues:
68
I'm trying to use XMLAdapter to load XML data from a file and then write the data to cursors using the ToCursor() method on the XMLTable objects. The problem is the cursors get created with the expected structure but do not contain any data.

The XML file is not terribly complex, although it does contain nested data (OrderHeader, OrderDetail, etc.). The schema is in an external XSD file. The LoadXML() method in my code returns True, with lValidateOnParse set True.

The XML file is from an external source over which I have no control, and I don't know what tool used was used to create it. Since LoadXML() is returning True, I'm not sure what else to look for. How do I go about debugging this further?

Code is as follows (VFP 9.0 SP1):
LOCAL loAdapter AS XMLAdapter
loAdapter = CREATEOBJECT( "XMLAdapter")
WITH loAdapter AS XMLAdapter
   .RespectNesting = .T.
   .XMLSchemaLocation = "PurchaseOrder.xsd"
   IF .LoadXML( "PurchaseOrder.xml", .T.)  && Returns .T.
      LOCAL loTable as XMLTable
      FOR EACH loTable IN .Tables
         IF loTable.Fields.Count > 0
            loTable.ToCursor()  && Cursor is created. but with no data.
            BROWSE
         ENDIF
      ENDFOR
   ENDIF
ENDWITH
loAdapter = NULL
-Rick
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform