Importing XML
408 DataWindow .NET
Selecting templates at runtime
Two DataWindow properties, Export.XML.TemplateCount and
Export.XML.Template[ ].Name, enable you to provide a list of templates from
which the user of the application can select at runtime.
The TemplateCount property gets the number of templates associated with a
DataWindow object. You can use this number as the upper limit in a
FOR loop
that populates a drop-down list with the template names. The
FOR loop uses
the Template[ ].Name property.
Before generating the XML, set the export template using the text in the
drop-down list box.
Importing XML
You can select XML as a file type in the dialog box that displays when you
select Rows>Import in the DataWindow painter. (The Preview view must be
open to enable the Rows>Import menu item.)
You can also import data from an XML document or string using the
ImportFile,
ImportString, or ImportClipboard methods. These methods have a parameter that
enables you to specify the type of data to be imported.
Data can be imported with or without a template. To import data without a
template, the data must correspond to the DataWindow column definition. The
text content of the XML elements must match the column order, column type,
and validation requirements of the DataWindow columns.
Composite and Graph DataWindow objects
Composite and Graph DataWindow objects cannot be imported using a
template. You must use the default format.