Exporting to XML
404 DataWindow .NET
Formatting the exported XML
By default, the XML is exported without formatting. If you want to view or
verify the exported XML in a text editor, check the Include Whitespace check
box or set the Export.XML.IncludeWhitespace property in code. Turning this
property on causes the export process to insert tabs, carriage returns, and
linefeed characters into the XML so that it is easier to read. Most of the
examples in this chapter were exported with this property turned on.
Do not import formatted XML
You should not try to import XML formatted with white space characters,
because the white space between data element tags is considered to be part of
the element.
Exporting metadata
You can specify that metadata in the form of a DTD or schema should be
exported when you save the DataWindow object. You can choose to save the
metadata with the XML or in a separate file.
If you export metadata as a schema, you can associate it with a namespace. See
“Associating a namespace with an exported schema” on page 406.
To specify how metadata should be saved, select a value from the Meta Data
Type drop-down list or set the
Export.XML.MetaDataType property. The
possible values are:
• XMLNone!—No metadata is generated
• XMLSchema!—An XML schema is generated
• XMLDTD!—A DTD is generated
The metadata is saved into the exported XML itself or into an associated file,
depending on the setting in the Save Meta Data drop-down list or the
Export.XML.SaveMetaData property. The possible values are:
• MetaDataInternal!—The metadata is saved into the generated XML
document or string. To save metadata using the
.Data.XML expression
syntax, you must use this value.
• MetaDataExternal!—The metadata is saved as an external file with the
same name as the XML document but with the extension .xsd (for a
schema) or .dtd (for a DTD). A reference to the name of the metadata file
is included in the output XML document.