Page 1 of 1

Repetetive XML tags

Posted: Thu Apr 03, 2008 6:11 pm
by debasisp
Hi,
I am reading a dataset and creating output XML.

Here is the XML output I am getting.

<Message>
<Main>
<Col1>18108</Col1>
<Col1>18108</Col1>
<Col1>18108</Col1>
<Col2>U00009473</Col2>
...............
</Main>
</Message>

First Column is repeting 3 times as the I have 3 rows present for that same key field.

I had used the key field that is specified in the dataset as the Trigger Column.

Can anyone please help me to get one row as Col1 in the XML output irrespective of duplicate rows.

Cheers
Debasis

Posted: Thu Apr 08, 2010 3:32 am
by dsnovice
Hello Debasis,

Try removing duplicate rows and send only the one record and keep the same trigger column Col1 in your XML output stage.

Else you will have to change your Trigger column to some other unique tag this way the aggregation will happen at a different level, like if you choose <main> as a tag you will have only one <col1>. So you will have to search for a unique column.

hth,
a novice

Posted: Thu Apr 08, 2010 5:38 am
by chulett
Can't check right now but there's an option in the XML Output stage to "group" your data from what I recall. How is that set?

Posted: Sun Apr 11, 2010 12:16 pm
by eostic
There may be more to this than what we can see here, as we don't have lots of detail about your source, but here are a few things to try:

a) for your simple example above (create a test with only those two columns) make Col2 your "key" and choose Aggregate option in the xml output stage.

b) for a second and separate test, add a few more columns at the col2 level (just dummy columns for test purposes, added in an upstream transformer)...I've seen some odd things happen with aggregation when there are 4 or fewer cols........

Ernie