Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems generating an XML using a XSD file
Message
From
11/05/2007 23:23:50
 
 
To
10/05/2007 13:06:43
Markus Winhard
Lauton Software GmbH
Nürnberg, Germany
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01224215
Message ID:
01224906
Views:
16
Markus,

>my first idea was to set loXmlAdapter.Tables[1].Fields[n].XMLName, but this property is read only...

Yes, the XMLName created by AddCursorSchema is actually used as the name of the item in the fields collection, so it cannot be changed unless you first get a reference to it and then remove it from the collection. Then you can change the XMLName to any name you want in the XML document and also set the case as needed to match the schema -- using STRCONV to set the value as a UNICODE string.

My Message#1090767 explains how to do this.

JOHN: The XMLSchemaLocation setting is not used to determine tag names for the XML you are creating in ToXML. Rather, the XMLSchemaLocation property tells XMLAdapter whether to create a schema for you when the XML file is being created.

Therefore, you probably want to set XMLSchemaLocation = "" to avoid having XMLAdapter create an XSD schema for you, since you already have the schema file. If you put an XSD filename in that property, it will create the file, or "1" in the property will force an inline schema right in the XML being created.

If, however, you want the XML Document to contain a reference to your external XSD file in its header info (so that any XML Parser reading the XML will automatically find the XSD), you can set the name of the XSD file in the ToXML() second parameter (cSchemaLocation). Otherwise, omit that param or set it to empty string and there will be no reference to the XSD added to the XML.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform