602SQL Documentation Index  

Global Properties of DAD

Global properties of DAD allow you to change or edit the methods connecting XML to the database and the declarations stated in the XML file header.

Global properties in the designer are set in the dialog bound to the first item in the tree. This dialog may also be opened using the Global properties command from the Design menu.

Modifying the Data Source

You may change or edit the data source for the DAD on the Base cursor tab in the XML Global properties dialog.

You may change the text of the SQL query used as a data source for a synthetic DAD. This field is empty for an analytic DAD, since the main table is bound to the lowest level of the tree.

Export to XML Properties

The DAD properties that are specific for export are described in the XML Global properties dialog on the Export to XML tab.

Prologue in DAD

The Prologue entry in the global parameters describes the declaration that will be placed at the beginning of the XML file. The prologue usually contains the XML version and the specification of data coding for export. You may select one of the supported codings that can be viewed using the Encoding button.

Prologue example:

version="1.0" encoding="windows-1250"

Will place the following line at the beginning of the XML file:

<?xml version="1.0" encoding="windows-1250"?>

The prologue defined in the DAD is ignored when importing data, since the coding from the XML file will be used.

DOCTYPE Declaration

You may specify the DOCTYPE declaration in the DAD global parameters. This declaration is placed in the exported XML file between the <!DOCTYPE and > characters. This is ignored on import.

Stylesheet in DAD

You may also specify a reference to a stylesheet that will be placed in the generated XML file.

The reference is placed in the XML file between the <?xml-stylesheet and ?> characters. Stylesheet information is ignored when importing data.

Formatting Whitespace

You choose the output format of the XML text with the Write formatting whitespace checkbox. If checked, the individual elements are on separate lines and indented according to the nesting level on the output. If unchecked, the formatting characters (blank space, tab and end of line) are omitted and the output is on a single line (smaller in size, but harder to read).

Cursor Optimization

In certain cases when connecting DAD via ODBC to data found in someone else´s database, it is necessary to disable optimization that works solely with the 602SQL server - more details are found here.

Import from XML Properties

The DAD properties specific for import are described in the XML Global properties dialog on the Import from XML tab.

If an error occurs during import, the entire import is rolled back. Some errors can be ignored, see below.

XML File Validation

If the internal or external declaration of the document structure is specified in the XML file, the parser validates the document when importing. If a validation error occurs, the import will be rolled back.

Validation can be disabled by checking the No validation checkbox.

Handling Undefined Text in XML

Let us consider the case that text is present in an element, for which there is no text defined in the DAD (no binding to a database column, variable or constant is defined).

If the declaration of the document structure prevents the occurrence of this text, the error may be detected when validating the document. If the text successfully passes through validation, the document structure is not declared or validation is disabled, an error will occur during import and the entire import will be rolled back.

The above error can be corrected by checking the Ignore unassociated XML text checkbox in the DAD global properties. If checked, the text will be ignored and the import will continue.

Handling an Undefined Element in XML

Let us consider the case that an element not described in the DAD is present in the XML file.

If the declaration of the document structure prevents the occurrence of this element, the error may be detected when validating the document. If the element successfully passes through validation, the document structure is not declared or validation is disabled, an error will occur during import and the entire import will be rolled back.

The above error can be corrected by checking the Ignore unknown elements checkbox in the DAD global properties. If checked, the element will be ignored and the import will continue. Subelements of the ignored element will be processed as normal.

Handling an Undefined Attribute in XML

Elements in the XML file may have attributes other than the ones described in the DAD. These attributes are ignored when importing and an error will not occur.

Root Namespace

External application handling XML data (e.g. 602XMLFiller) can require utilization of so-called namespace that delimits XML tag validity. The namespace is defined by an identifier and a prefix with a colon before the element (XML tag) name.

During data export, the prefix is inserted before each element name and a reference to the namespace is inserted as an attribute of the root element; on the other hand, during import, the prefix is removed from the XML data, so that the values from the XML data could be assigned to relevant columns or variables found in DAD.

Specify the namespace prefix into the Prefix field (without colon), reference to the namespace enter into the Namespace field (in accordance with external program documentation). If the root element of the resulting XML should look, e.g., like follows:

<dm:root xmlns:dm="http://software602.cz/forms">
Specify into the Prefix field
dm
and into the Namespace field
http://software602.cz/forms

Actions after the Import

In the Import results tab, you specify actions following the successful data import from XML. This is used when it is necessary to return some data or text after import; in real-life working especially in cases when import is invoked from the 602XML Filler environment. Following actions are available:

By analogy, the Import failure message tab specifies a message informing of failure.