I am using XML Extender Fix Pack 9 (DB2 7.4) and trying to shred an XML
instance that has a unique id as an element under the root element and the
shredding fails, where as when I move the id attributes to be as attributes
to the root element, the shredding succeeds.
If you can help, please read the more technical details ahead, thanks,
Part of the XML that fails:
----------------------------------------
<ClinicalDocument>
< id root="123" extension="999"/>
<code code="11488" codeSystem="2.16.840.1.113883.6.1"
displayName="Consultationnote"/>
XML that is shredded well:
------------------------------------
<ClinicalDocument root="123" extension="999">
<code code="11488" codeSystem="2.16.840.1.113883.6.1"
displayName="Consultationnote"/>
Part of the DAD that fails (see error message below)
------------------------------------------------------------------------
<element_node name="ClinicalDocument">
<RDB_node>
<table name="cda_header" key="id_root id_extension"/>
<table name="cda_header_names" key=" id_root id_extension first_name
family_name"/>
<condition>
cda_header.id_extension = cda_header_names.id_extension AND
cda_header.id_root = cda_header_names.id_root
</condition>
</RDB_node>
<element_node name="id" multi_occurrence="NO">
<attribute_node name="extension">
<RDB_node>
<table name="cda_header"/>
<column name="id_extension" type="varchar(64)"/>
</RDB_node>
</attribute_node>
<attribute_node name="root">
<RDB_node>
<table name="cda_header"/>
<column name="id_root" type="varchar(64)"/>
</RDB_node>
</attribute_node>
</element_node>
<element_node name="code" multi_occurrence="NO">
<attribute_node name="code">
<RDB_node>
<table name="cda_header"/>
<column name="code_code" type="varchar(64)"/>
</RDB_node>
</attribute_node>
<attribute_node name="codeSystem">
<RDB_node>
<table name="cda_header"/>
<column name="code_code_system" type="varchar(64)"/>
</RDB_node>
</attribute_node>
<attribute_node name="displayName">
<RDB_node>
<table name="cda_header"/>
<column name="code_display_name" type="varchar(64)"/>
</RDB_node>
</attribute_node>
</element_node>
The DAD that works well:
---------------------------------------
element_node name="ClinicalDocument">
<RDB_node>
<table name="cda_header" key="id_root id_extension"/>
<table name="cda_header_names" key=" id_root id_extension first_name
family_name"/>
<condition>
cda_header.id_extension = cda_header_names.id_extension AND
cda_header.id_root = cda_header_names.id_root
</condition>
</RDB_node>
<attribute_node name="extension">
<RDB_node>
<table name="cda_header"/>
<column name="id_extension" type="varchar(64)"/>
</RDB_node>
</attribute_node>
<attribute_node name="root">
<RDB_node>
<table name="cda_header"/>
<column name="id_root" type="varchar(64)"/>
</RDB_node>
</attribute_node>
The error message :
-------------------------------
Java Shred Stored Procedure Sample
*****************************
Connect to xmltest9
Calling stored procedure : db2xml.dxxShredXML
errCode = -126
msgText = DXXQ044E Element code does not have an ancestor element