Exporting to XML
398 DataWindow .NET
Processing instructions
Processing instructions (PIs) enable you to provide information to the
application that uses the processed XML. Processing instructions are enclosed
in
<? and ?> delimiters and must have a name, called the target, followed by
optional data that is processed by the application that uses the XML. Each
application that uses the XML must process the targets that it recognizes and
ignore any other targets.
The XML declaration at the beginning of an XML document is an example of
a processing instruction. You cannot use the string
xml as the name of any other
processing instruction target.
Example
In this example, usething is the name of the target, and thing=this.thing
is the data to be processed by the receiving application:
<?usething thing=this.thing?>
Exporting to XML
You can export the data in a DataWindow or DataStore object to XML using
any of the techniques used for exporting to other formats such as PSR or
HTML:
• Using the
SaveAs method:
ds_1.SaveAs("C:\TEMP\Temp.xml", Xml, true)
• Using the Describe method:
ls_xmlstring = dw_1.Describe(DataWindow.Data.XML)
• Using the Save Rows As menu item in the DataWindow painter.
With the Preview view open, select File>Save Rows As, select XML from
the Files of Type drop-down list, provide a file name, and click Save. You
can use this in the development environment to preview the XML that will
be generated at runtime.
When you export data, DataWindow Designer uses an export template to
specify the content of the generated XML.