Page 1 of 1

XML input stage issue

Posted: Thu Jun 28, 2012 3:39 am
by vermas5
Hi,

I am trying to parse a XML file and write it to a text file. I am not getting the correct output.
XML file used is:-
<?xml version="1.0" encoding="UTF-8"?>
<Fields>
<Col_1>7542></Col_1>
<Col_2>Success</Col_2>
</Fields>

The output that is received in the file is:-
"<Col_1>7542</Col_1>","<Col_2>Success</Col_2>"

The correct output should be:-
"7542","Success"

This was working correctly in datastage version 8.0 but recently we migrated to 8.5 where we are facing this issue. How can I solve this?

Posted: Thu Jun 28, 2012 4:47 am
by ray.wurlod
Change the quote character in the Sequential File stage from double-quote to None.

Posted: Thu Jun 28, 2012 5:20 am
by eostic
It looks like you want the quotes? ...but don't want the tag characters (left and right caret < and > ? ....

To remove the carets, open the xmlInput Stage, go to the output link and scroll to the Descriptions of the columns on that link...make sure that each of the entries ends with "text()" for the entries that are xml elements. It sounds as though each Description is only ending with a /. ...that means "give me the whole tag, including the carets".

Ernie

Posted: Fri Jun 29, 2012 6:00 am
by vermas5
Thanks, the issue is resolved now. "text()" property was required to be added in XML output stage Output tab for this version. It was working fine without this in 8.0.