I haven't seen this in awhile. Noticed it most often when there are very few columns in the sub-columns of the repeating node.
Try this: Add a dummy column that is 100% unique (use something like @INROWNUM upstream)...put this dummy column just above ProdCode in the link and give it xpath (the Description property) that looks just like ProdCode but with /dummy/text() at the end instead of ProdCode/text().
See if that produces the xml that you need....of course, it will have an extra element called "dummy".......put an output link on your xmlOutput Stage with a single large varchar column and a single '/' in the Description property. Send that to a Transformer or other means for removing the dummy element.
Ernie
XML Output stage repeats element
Moderators: chulett, rschirm, roy
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 35
- Joined: Wed Jun 15, 2005 9:27 am
I realized a pattern that is related to the order how input records are processed:
If "identic" elements are processed sequentially, i.e., one right after another, then Datastage "aggregates" them inadequately.
If by chance they are not processed sequentially then xml is created as intended.
About your suggestion, I am not a fan of that solution but I guess Datastage was not born to deal perfectly with xml. Anyway we tried and it worked, introducing a unique dummy element and then removing it is our workaround at the moment.
Our choice to remove dummy elements was to use unix AWK command (SED is slower). For those who might be interested, it should be something like this:
awk '{a=$0;gsub("<DUMMYID>[0-9]*</DUMMYID>","",a);print a}' INPUTFILE.xml > OUTFILE.xml
Thank you.
If "identic" elements are processed sequentially, i.e., one right after another, then Datastage "aggregates" them inadequately.
If by chance they are not processed sequentially then xml is created as intended.
About your suggestion, I am not a fan of that solution but I guess Datastage was not born to deal perfectly with xml. Anyway we tried and it worked, introducing a unique dummy element and then removing it is our workaround at the moment.
Our choice to remove dummy elements was to use unix AWK command (SED is slower). For those who might be interested, it should be something like this:
awk '{a=$0;gsub("<DUMMYID>[0-9]*</DUMMYID>","",a);print a}' INPUTFILE.xml > OUTFILE.xml
Thank you.
-
- Participant
- Posts: 73
- Joined: Wed Sep 30, 2009 5:20 am
-
- Participant
- Posts: 35
- Joined: Wed Jun 15, 2005 9:27 am
-
- Participant
- Posts: 73
- Joined: Wed Sep 30, 2009 5:20 am