Sybase 2 Barcode Reader User Manual


 
CHAPTER 14 Exporting and Importing XML Data
DataWindow Designer User’s Guide 383
Event-based APIs use callbacks to report events, such as the start and end
of elements, to the calling application, and the application handles those
events. These APIs provide faster, lower-level access to the XML and are
most efficient when extracting data from an XML document in a single
traversal.
For more information about the best-known event-driven parser, SAX
(Simple API for XML), see the
SAX page at http://sax.sourceforge.net/.
Xerces parser
DataWindow Designer includes software developed by the Apache Software
Foundation (
http://www.apache.org/). The XML services for DataWindow
objects are built on the Apache Xerces-C++ parser, which conforms to both
DOM and SAX specifications. For more information about SAX, see the
Xerces C++ Parser page at http://xml.apache.org/xerces-c/index.html.
XML support in the DataWindow painter
DataWindow Designer supports both the export and import of XML in
DataStore and DataWindow objects using XML template objects. You
construct XML templates for export and import graphically in the
Export/Import Template view for XML. Each template you create is
encapsulated in the DataWindow object. A template enables you to specify the
XML logical structure of how the row data iterates inside the root element of
the XML document.
Export templates
An XML export template lets you customize the XML that is generated.
You can specify optional XML and document type declarations that precede
the root element in the exported XML, as well as the logical structure and
nesting level of iterative DataWindow row data inside the root element. The
children of the root element can contain elements, character references, and
processing instructions as well as the row data, using explicit markup. For
more information, see “Header and Detail sections” on page 387.
If the exported XML is used by different applications or processes, you can
define a separate export template for each use.
Import templates
You need to create an import template if you want to import data that does not
match the DataWindow column definition or is associated with a schema, or if
you want to import attribute values.
Only the mapping of column names to element and attribute names is used for
import. All other information in the template is ignored.