Home > References

XML Imports


Introduction

XML imports can be performed by means of the EBX.Manager user interface ("Actions" menu of a table), Data Services ( insert or update operations ), or directly in Java (class ImportSpec ).

An XML import is always done in the context of an adaptation instance. This target adaptation will be updated with the content of the imported XML document.

Documents encoding

The XML document to be imported must be in UTF-8 exclusively

Documents structure

The XML document used as the source must conform to the XML schema associated to the target adaptation instance.

However, it can also be a subset of a conforming document. For example, it can contain a single table /root/domain1/tableC . The partial content must preserve the whole location in the schema (hence a location such /domain1/tableC would be refused). The next section explains the import behaviour in more detail.

Import Behaviour

Import mode

For a given source record to be imported, the operation to perform on the target table depends on the specified import mode:

Insert operation

The following table summarizes the behaviour of insert operations when an element of the record to be inserted is not present, or has a particular state.

State of source element

Behaviour

Source element is not present

No specific set is done on the new record. This implies:

  • If element corresponds to a terminal node and the target adaptation instance is root , it has the default value defined in schema.

  • If element corresponds to a terminal node and the target adaptation instance is not root , it inherits from parent adaptation.

  • If element is under a terminal node and the container is a JavaBean, it has the default JavaBean value.

Source element is present but empty: <element/>

  • For nodes of type xs:string (or a sub-type), the target element is set to an empty string.

  • For other nodes (non xs:string type), the target element is set to null (however, please note that such an element does not conform to XML Schema).

See also EBX.Platform whitespaces management for Data Types .

Source element is present and null: <element xsi:nil="true"/>

Target element is always set to null.

Update operation

The following table summarizes the behavior of update operations when the element of the record to be updated is not present or it has a particular state.

State of source element

Behaviour

Source element is not present

  • If the target element is a terminal node , its value is not changed.

  • If the target element is under a terminal element, its value is set to null.

Source element is present but empty: <element/>

  • For nodes of type xs:string (or a sub-type), the target element is set to an empty string.

  • For other nodes (non xs:string type), the target element is set to null (please note however that such an element does not conform to XML Schema).

See also EBX.Platform whitespaces management for Data Types .

Source element is present and null: <element xsi:nil="true"/>

Target element is always set to null.

Known limitations

Date, time & dateTime format

Supported formats are:

Type

Format

Example

xs:date

yyyy-MM-dd

2007-12-31

xs:time

HH:mm:ss or HH:mm:ss.SSS

11:55:00

xs:dateTime

yyyy-MM-ddTHH:mm:ss or yyyy-MM-ddTHH:mm:ss.SSS

2007-12-31T11:55:00

Home > References