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 mode: only record creations are allowed. If, in the target table, a record exists with the same primary as in the source, an error is returned and the whole operation is cancelled.
-
Update mode: only modifications of existing records are allowed. If, in the target table, a record with the same primary does not exist, an error is returned and the whole operation is cancelled.
-
Update or insert mode: if a record with the same primary key exists in the target table, it is updated; otherwise, a new record is inserted.
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:
|
|
Source element is present but empty:
|
|
|
Source element is present and null:
|
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 |
|
|
Source element is present but empty:
|
|
|
Source element is present and null:
|
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