Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLAdapter can't parse but XMLTOCursor can
Message
De
26/04/2005 23:04:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01008651
Message ID:
01008706
Vues:
14
Maximo,

>David,
>Perfect, it worked, thanks for clarifying Aleksey's answer.
>Great questions for Aleksei too, I'm really curious about those.

From what I can see, XMLAdapter expects to find a Schema to use -- either an inline schema or external -- in automatically setting up XMLTable and XMLField objects when it loads some XML.

If you have XML with no schema, you can still load the XML into the DOM with LoadXML, but you will then have to define your own XMLTable and XMLField objects and add them to the proper collections after loading XML (by using the new XPath capabilities of XMLAdapter).

If the XML with a schema will not load (as in this case) and gives the "XML Schema is too complex" error, you can bypass it by first setting XMLSchemaLocation = "" before the LoadXML, but you will still need to set up the Table and FIeld objects (unless there is another shortcut that Aleksey can show).

Although in this case you saw the simpler XMLTOCURSOR load up the data, it obviously could not handle the bad datatype case and skipped that field, where XMLAdapter just choked and gave the "too complex" error. Neither approach could automatically give you what you needed without changing the schema to a proper definition (dateTime).

I wonder if the "strictness" in handling the bad case of "datetime" is a VFP thing, or if the MSXML DOM also chokes on it. Kind of strange that the other MS product is spitting out such a broken schema, huh?
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform