Sybase 2 Barcode Reader User Manual


 
CHAPTER 14 Exporting and Importing XML Data
DataWindow Designer User’s Guide 411
Using export templates for import
If you have already defined an export template for a DataWindow object, you
can use it as an import template, but only the mapping of column names to
element attribute names is used for import. All other information in the
template is ignored.
The template you select in the list box is used to conform the XML imported
to the specifications defined in the named template. Selecting a template from
the list sets the DataWindow object’s Import.XML.UseTemplate property. You
can also modify the value of the Import.XML.UseTemplate property
dynamically in code.
The Data Import page also contains a check box that enables you to create a
trace log of the import. See “Tracing import” on page 416.
Example
This example uses a DataWindow object that includes the columns emp_id,
emp_fname, emp_lname, and dept_id. The template used in this example
includes only these columns. Any other columns in the DataWindow remain
empty when you import using this template.
To illustrate how template import works, create a new template that has one
element in the header section, called before_detail_marker. This element
contains a column reference to the
emp_id column.
The Detail Start element, employee, has an attribute, dept_id, whose value is a
control reference to the column
dept_id. It also has three children:
The emp_id element contains a column reference to the
emp_id column.
The emp_fname element contains static text.