Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create empty cursors from XSD?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00963628
Message ID:
00963872
Vues:
7
Thanks,

Unfortunatly, I think my schema is too complicated for the standard VFP XMLAdapter. It's for some tax form which would essentially be built from three cursors. However, I seem to be having some luck using MS's DOM. I'm still playing with it, but I was able to load the schema without an XML file.

Here's what I've done so far:
oschema=CREATEOBJECT("MSXML2.XMLSchemaCache.4.0")
oschema.add("http://www.irs.gov/eforms","8872SchemaV22.xsd")
loXML = CREATEOBJECT("MSXML2.DOMDocument.4.0")
loxml.schemas=oschema
Now i just need to figure out how to stick in the data prior to generating the XML.

Thanks for getting me started.


>You can create a string with XML structure and use XMLToCursor function:
>
>
>
>lcMyXSD="Sales.xsd"
>TEXT TO lcXML NOSHOW TEXTMERG
><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
><VFPData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<<lcMyXSD>>"/>
>ENDTEXT
>?XMLToCursor(lcXML,lcMyCursor,0)
>
>Update
>I didn't see you need it with XMLAdapter, but it's the same:
>
>oXML = CREATE("XMLAdapter")
>oXML.LoadXML(lcXML,.F.)
>WITH oXML.Tables(1)
>  .Alias = lcMyCursor
>  .ToCursor()
>ENDWITH
>
>HTH
>>Hello,
>
>>Got an XML newbie question. I have an XSD file (2, actually. One including the other.) provided by a 3rd party. I need to create the XML according to this schema. Is there a way to load this XSD into the XMLAdapter to get empty cursors? Or, if I need to attach the appropriate cursors myself, is there some tool available to help read the XSD?
>
>>Thanks in advance
>
>>Dan Goodwin
>>Primary Data Solutions
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform