In OIG, all XML documents are mapped to a set of database tables and their associated relational model. The OIG XML document definition is used to determine the structure of the XML document produced from the relational model by defining both the structure of the data and the formatting of the data. When the XML document is produced, only the initial data selection and the parent Gateway document definition are specified. The document definitions supply the data access specifications to navigate the data model. When an XML document is consumed, the OIG document definition is used to format the parsed data and enter the data into the associated databases.
An XML field map has two complementary purposes. First, when an XML document is being produced, the field map is used to define what data is to be included in the document, and to determine how this data is represented in the document. Second, when an XML document is being consumed, the field map defines the way that data parsed from the document is processed and where the data is entered into the database.
Every table within an XML document has a root name. Unlike the root name for an XML document, the root name element for a table will appear once for every row of the table being mapped. Fields of a row of a table can be mapped to attributes of the table root name or some sub-element of the table root name, except as described in
, Restrictions That Apply to Tables with No Root Name. The following sections contain examples for your use.
In the example below, a single table is mapped to an XML document. The element “employees” is the root name of an XML document and “employee” is a table root name.
There are circumstances where an XML document required less structure. Such documents can be consumed or produced by mapping a table with a single row and not specify root name for the table. The following example shows this structure: PolicyOwner is the root name of the XML document, followed by only the field name Value.