Chapter 6. RDB and XML integration 141
For decomposing or enabling an XML collection specified in the DAD
file, you must specify a primary key for each table.
Use the orderBy attribute to recompose XML documents containing
elements or attributes with multiple occurrence.
RDB_node for each attribute and text_node
Specify an RDB_node for each attribute_node and text_node, telling the
stored procedure from which table/column and under which condition to
get data:
i. Specify the name of the table containing the column data. The table
name must be included in the RDB_node of the top element_node. In
Figure 5-8, the text_node of element <startdate> i s associated with the
table emp_act. The RDB_node mapping is shown in Example 6-17.
Example 6-17 RDB_node mapping
<element_node name="startdate">
<text_node>
<RDB_node>
<table name="emp_act"/>
<column name="emstdate"/>
<condition>
emstdate > 2001-01-01
/condition>
</RDB_node>
</text_node>
</element_node>
ii. Specify the name of the table column that contains the data for the
element. In Example i, we specified the column EMSTDATE.
iii. Specify the condition under which the XML data is generated. In
Example i, we specified the condition for generating the XML data for
projects with project start date greater than 2001-01-01.
iv. For decomposing a d ocument or enabling the XML collection specified
in the DAD file, you must specify the column type for each
attribute_node and text_node. For example, we can specify that the
column type for EMPNO is CHAR as follows:
<column name=”empno” type=char”>
XML Extender admini stration tools
The XML Extender administration functions help you to enable your dat abase
and table columns for XML, and map XML data to DB2 relational structures. XML
Extender provides the following tools to complete administration tasks: