4Agora você pode decompor documentos que contêm nomes de atributos e/ou de 4elementos não exclusivos que são mapeados para diferentes colunas (de tabelas 4iguais ou diferentes) sem receber o erro DXXQ045E. A seguir está um 4exemplo de um documento XML com nomes de atributos e elementos não 4exclusivos:
4<Order ID="0001-6789"> 4 <!-- Note: attribute name ID is non-unique --> 4 <Customer ID = "1111"> 4 <Name>John Smith</Name> 4 </Customer> 4 <!-- Note: element name Name is non_unique --> 4 <Salesperson ID = "1234"> 4 <Name>Jane Doe</Name> 4 </Salesperson> 4 <OrderDetail> 4 <ItemNo>xxxx-xxxx</ItemNo> 4 <Quantity>2</Quantity> 4 <UnitPrice>12.50</UnitPrice> 4 </OrderDetail> 4 <OrderDetail> 4 <ItemNo>yyyy-yyyy</ItemNo> 4 <Quantity>4</Quantity> 4 <UnitPrice>24.99</UnitPrice> 4 </OrderDetail> 4</Order>
4O DAD de acompanhamento, que mapeia os elementos/atributos duplicados para 4diferentes colunas, tem o seguinte aspecto:
4<element_node name="Order"> 4 <RDB_node> 4 <table name="order_tab" key="order_id"/> 4 <table name="detail_tab"/> 4 <condition> 4 order_tab.order_id = detail_tab.order_id 4 </condition> 4 </RDB_node> 4 4 <!--attribute ID duplicated below, but mapped to a different col--> 4 <attribute_node name="ID"> 4 <RDB_node> 4 <table name="order_tab" /> 4 <column name="order_id" type="char(9)"/> 4 </RDB_node> 4 </attribute_node> 4 4 <element_node name="Customer"> 4 <!--attribute ID duplicated above, but mapped to a different col--> 4 <attribute_node name="ID"> 4 <RDB_node> 4 <table name="order_tab" /> 4 <column name="cust_id" type="integer"/> 4 </RDB_node> 4 </attribute_node> 4 4 <!--element name duplicated below, but mapped to a different col--> 4 <element_node name="Name"> 4 <text_node> 4 <RDB_node> 4 <table name="order_tab" /> 4 <column name="cust_name" type="char(20)" /> 4 </RDB_node> 4 </text_node> 4 </element_node> 4 </element_node> 4 4 <element_node name="Salesperson"> 4 <!--attribute ID duplicated above, but mapped to a different col--> 4 <attribute_node name="ID"> 4 <RDB_node> 4 <RDB_node> 4 <table name="order_tab" /> 4 <column name="salesp_id" type="integer"/> 4 </RDB_node> 4 </attribute_node> 4 4 <!--element name duplicated above, but mapped to a different col--> 4 <element_node name="Name"> 4 <text_node> 4 <RDB_node> 4 <table name="order_tab" /> 4 <column name="salesp_name" type="char(20)" /> 4 </RDB_node> 4 </text_node> 4 </element_node> 4 </element_node> 4 4 <element_node name="OrderDetail" multi_occurrence="YES"> 4 <element_node name="ItemNo"> 4 <text_node> 4 <RDB_node> 4 <table name="detail_tab" /> 4 <column name="itemno" type="char(9)"/> 4 </RDB_node> 4 </text_node> 4 </element_node> 4 <element_node name="Quantity"> 4 <text_node> 4 <RDB_node> 4 <table name="detail_tab" /> 4 <column name="quantity" type="integer"/> 4 </RDB_node> 4 </text_node> 4 </element_node> 4 <element_node name="UnitPrice"> 4 <text_node> 4 <RDB_node>detail_tab" /> 4 <table name="detail_tab" /> 4 <column name="unit_price" type="decimal(7,2)"/> 4 </RDB_node> 4 </text_node> 4 </element_node> 4 </element_node> 4</element_node>
4O conteúdo das tabelas teriam o seguinte aspecto após a decomposição do 4documento acima:
4ORDER _TAB: 4 4ORDER_ID CUST_ID CUST_NAME SALESP_ID SALESP_NAME 40001-6789 1111 John Smith 1234 Jane Doe 4 4DETAIL_TAB: 4 4ORDER_ID ITEMNO QUANTITY UNIT_PRICE 40001-6789 xxxx-xxxx 2 12.50 40001-6789 yyyy-yyyy 4 24.99