By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

Decomposing XML

P: n/a
Hello,

I am trying to decompose an XML Dokument into some tables. The structure
of the XML-Document is as follows:

<LIST_1>
<ELEMENT_1>
<VAL_1>8919101000000000000000002672005031318:27</VAL_1>
...
<VAL_29>0</VAL_29>
<LIST_1_1>
<ELEMENT_1_1>
<VAL_1_1>1</VAL_1_1>
...
<VAL_1_25>01</VAL_1_25>
</ELEMENT_1_1>
<ELEMENT_1_1>
<VAL_1_1>1</VAL_1_1>
...
<VAL_1_25>01</VAL_1_25>
</ELEMENT_1_1>
<ELEMENT_1_1>
<VAL_1_1>1</VAL_1_1>
...
<VAL_1_25>01</VAL_1_25>
</ELEMENT_1_1>
</LIST_1_1>
<LIST_1_2>
<ELEMENT_1_2>
<VAL_2_1>1</VAL_2_1>
...
<VAL_2_9>01</VAL_2_9>
</ELEMENT_1_2>
<ELEMENT_1_2>
<VAL_2_1>1</VAL_2_1>
...
<VAL_2_9>01</VAL_2_9>
</ELEMENT_1_2>
</LIST_1_2>
<ELEMENT_1_3>
<VAL_3_1>1</VAL_3_1>
<!-- <VAL_3_2>16</VAL_3_2> -->
</ELEMENT_1_3>
</ELEMENT_1>
</LIST_1>

For this XML I have built a DAD-file an it works fine. But when I remove
the comment around VAL_3_2 and start "dxxshrd mydb my.dad my.xml" I get
the following mesage:

Connecting to database mydb
errCode=-57:0
msgtext'DXXG001E An internal error occured in build "Apr 22
2005/20:01:49", file "dxxrdbi.sqx", and line "3103".

Does anybody know what happens? The tracefile only says "Failed to find
'VAL_3_2' in 'ELEMENT_1'."

Thanks in advance an kind regards

Martin Zillner
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Martin,

Can you post your DAD as well?

Thanks,

Tom

Nov 12 '05 #2

P: n/a
Hi,

this is the DAD I use:

<?xml version="1.0"?>
<!DOCTYPE DAD SYSTEM ".../samples/db2xml/dtd/dad.dtd">
<DAD>
<dtdid>bon.dtd</dtdid>
<validation>NO</validation>
<Xcollection>
<prolog>?xml version="1.0" encoding="UTF-8"?</prolog>
<doctype>!DOCTYPE BONLISTE SYSTEM ".../bon.dtd"</doctype>
<root_node>
<element_node name="LIST_1">
<RDB_node>
<table name="TABLE_1" key="ID"/>
<table name="TABLE_2" key="ID"/>
<table name="TABLE_3" key="ID"/>
<table name="TABLE_4" key="ID"/>
<condition>TABLE1_1.ID = TABLE1_2.ID AND TABLE1_1.ID = TABLE1_3.ID AND
TABLE1_1.ID = TABLE1_4.ID</condition>
</RDB_node>
<element_node name="ELEMENT_1" multi_occurrence="YES">
<element_node name="VAL_1">
<text_node>
<RDB_node>
<table name="TABLE_1"/>
<column name="COL1_1" type="VARCHAR(40)"/>
</RDB_node>
</text_node>
</element_node>
....
<element_node name="VAL_29">
<text_node>
<RDB_node>
<table name="TABLE_1"/>
<column name="COL_1_29" type="INT"/>
</RDB_node>
</text_node>
</element_node>
<element_node name="LIST_1_1">
<element_node name="ELEMENT_1_1" multi_occurrence="YES">
<element_node name="VAL_1_1">
<text_node>
<RDB_node>
<table name="TABLE_2"/>
<column name="COL_2_1" type="INT"/>
</RDB_node>
</text_node>
</element_node>
....
<element_node name="VAL_1_25">
<text_node>
<RDB_node>
<table name="TABLE_2"/>
<column name="COL_2_25" type="VARCHAR(2)"/>
</RDB_node>
</text_node>
</element_node>
</element_node>
</element_node>
<element_node name="LIST_1_2">
<element_node name="ELEMENT_1_2" multi_occurrence="YES">
<element_node name="VAL_2_1">
<text_node>
<RDB_node>
<table name="TABLE_3"/>
<column name="COL_3_1" type="INT"/>
</RDB_node>
</text_node>
</element_node>
....
<element_node name="VAL_2_9">
<text_node>
<RDB_node>
<table name="TABLE_3"/>
<column name="COL_3_9" type="VARCHAR(2)"/>
</RDB_node>
</text_node>
</element_node>
</element_node>
</element_node>
<element_node name="ELEMENT_1_3">
<element_node name="VAL_3_1">
<text_node>
<RDB_node>
<table name="TABLE_4"/>
<column name="COL_4_1" type="VARCHAR(10)"/>
</RDB_node>
</text_node>
</element_node>
<!-- <element_node name="VAL_3_2"> -->
<!-- <text_node> -->
<!-- <RDB_node> -->
<!-- <table name="TABLE_4"/> -->
<!-- <column name="COL_4_2" type="DECIMAL(5,2)"/> -->
<!-- </RDB_node> -->
<!-- </text_node> -->
<!-- </element_node> -->
</element_node>
</element_node>
</element_node>
</root_node>
</Xcollection>
</DAD>

Thanks for support

Martin
Nov 12 '05 #3

P: n/a
Hi Martin,

I likely won't be able to take a closer look at your problem until next
week.

In the meantime:
1) I assume in your DAD you had the VAL_3_2 element_node uncommented
while you were getting the error, and you commented it out just to keep
working but forgot to uncomment it before posting.

2) have you tried running the DAD checker as a sanity check?
http://www-306.ibm.com/software/data...downloads.html
It is in the beta packages section.

Tom

Nov 12 '05 #4

P: n/a
Hi Tom,

in the meantime IBM Support gave me an answer: The suggest even to use
'multi_occurrence="YES"' for 'ELEMENT_1_3' though it does only occur one
time, but that works.

The more strange issue is that the documentation say, there can only
1024 rows be inserted in one table from one XML document. That menas, we
have to split or data into hundreds of files and maintain them. Therefor
we have implmented a perl script using the XMLtoRDBMS module an that
works fine.

Thanks for support and kind regards

Martin
tominame.com schrieb:
Hi Martin,

I likely won't be able to take a closer look at your problem until next
week.

In the meantime:
1) I assume in your DAD you had the VAL_3_2 element_node uncommented
while you were getting the error, and you commented it out just to keep
working but forgot to uncomment it before posting.

2) have you tried running the DAD checker as a sanity check?
http://www-306.ibm.com/software/data...downloads.html
It is in the beta packages section.

Tom

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.