XML Output
Moderators: chulett, rschirm, roy
XML Output
Hi,
I am working on java integration and for that I need to pass XML data. I am using XML output to get XML format from oracle table data. If I am passing duplicate rows I am getting only one row (first tag is repeating). Please take a look at below output format. I need 3 rows separately. Please advise me.
Input:
Title -- Initials
Student Assistant -- F
Student Assistant -- F
Student Assistant -- F
Output:
-<users>
-<user>
<title> Student Assistant </title>
<title> Student Assistant </title>
<title> Student Assistant </title>
<initials> F </initials>
</user>
</users>
I am working on java integration and for that I need to pass XML data. I am using XML output to get XML format from oracle table data. If I am passing duplicate rows I am getting only one row (first tag is repeating). Please take a look at below output format. I need 3 rows separately. Please advise me.
Input:
Title -- Initials
Student Assistant -- F
Student Assistant -- F
Student Assistant -- F
Output:
-<users>
-<user>
<title> Student Assistant </title>
<title> Student Assistant </title>
<title> Student Assistant </title>
<initials> F </initials>
</user>
</users>
Bhanu
Try adding a unique counter as another column just before title. You can remove it later.
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>
I added an extra field "Num" (using surrogate key generator) to that then it started returning output like this.
Input:
Num -- Title -- Initials
61 -- Student Assistant -- F
62 -- Student Assistant -- F
63 -- Student Assistant -- F
Output:
-<users>
-<user>
<num> 61 </num>
<num> 62 </num>
<num> 63 </num>
<title> Student Assistant </title>
<initials> F </initials>
</user>
</users>
Please advise me.
Thank you,
Input:
Num -- Title -- Initials
61 -- Student Assistant -- F
62 -- Student Assistant -- F
63 -- Student Assistant -- F
Output:
-<users>
-<user>
<num> 61 </num>
<num> 62 </num>
<num> 63 </num>
<title> Student Assistant </title>
<initials> F </initials>
</user>
</users>
Please advise me.
Thank you,
Bhanu
check your xpath. make sure each one ends with "text()"
Like:
/import-users-request/users/user/num/text()
and then also check that you are using "aggregate" on the detail tab of the output link and make num your only "key".
We'll assume also that the rows are arriving in this exact order (ie...for this test, don't have a multi-node config or anything else that might confuse the issue)
Ernie
Like:
/import-users-request/users/user/num/text()
and then also check that you are using "aggregate" on the detail tab of the output link and make num your only "key".
We'll assume also that the rows are arriving in this exact order (ie...for this test, don't have a multi-node config or anything else that might confuse the issue)
Ernie
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>
At the moment I am not sure and right now I don't have access to DataStage to try anything.......I recall a very strange behavior from many years ago where fewer than 4 columns created some issues. As a test that wouldn't be too hard to try, add two more cols and see if it impacts anything (add num1 and num2, with equivalent xpath for a total of 5 cols). It might do nothing or might hint at what the issue is.
Ernie
Ernie
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>
So far, your xmloutput stage input link looks fine, so tell us about the rest of your Job. And in the meantime, test your xmloutput stage as is in a job that reads those same 3 or 4 rows from a sequential file.
What other stages are there that might be influencing things?
Ernie
What other stages are there that might be influencing things?
Ernie
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>
One more thing to also try.....on the test that you have that uses the "num" column, I asked you to make it the "key" (repetition element). It wouldn't hurt to try a test where, with that same Job, you make title the key (turn "OFF" the key for num).
Ernie
Ernie
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>