XML out file format issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
akonda
Participant
Posts: 97
Joined: Wed Feb 28, 2007 6:15 am

XML out file format issue

Post by akonda »

Hello

I am trying to generate xml file using using xml output stage. The xml file is getting created but the format of is not as expected. Please suggest if anybody come across this before.

Design:

oracle connector -> transformer stage -> xml output stage.

Getting output as below:

<claim>
<casetype>
U
</casetype>
<casedate>
2012-12-13 17:55:25
</casedate>
<esn>
100000002074127
</esn>
<newesn>
1000000020
</newesn>
<trackingnumber>
trac:12345
</trackingnumber>
</claim>


Output Need like below:

<claim>
<casetype> U </casetype>
<casedate> 2012-12-13 18:11:09 </casedate>
<esn> 100000002074135 </esn>
<newesn> 1000000020 </newesn>
<trackingnumber> trac:12345 </trackingnumber>
</claim>
<claim>


Thanks
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You'll see the answer to this one if you search around.......find the "formatted xml" check box and turn it off --- you want NO formatting. ...and then start opening the xml in your browser or other XML-aware tool. XML should just be a continuous string without any CRLF's, returns or other formatting. As far as xml is concerned, all of that is just "noise".

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
akonda
Participant
Posts: 97
Joined: Wed Feb 28, 2007 6:15 am

Post by akonda »

Thanks for your reply.

Sorry I did not find similar post in my search.

If I remove the "Generate Formatted Output" check box, entire record is displaying in single line.

<claims><claim><casetype>U</casetype><casedate>2012-12-13 17:55:25</casedate><esn>1000000020</esn><newesn>1000000020</newesn><trackingnumber>trac:12345</trackingnumber></claim><claim><casetype>U</casetype><casedate>2012-12-13 18:11:09</casedate><esn>1000000020</esn><newesn>1000000020</newesn><trackingnumber>trac:12345</trackingnumber></claim></claims>.


Do I need to set format using transformer stage before XML Output stage ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

akonda wrote:If I remove the "Generate Formatted Output" check box, entire record is displaying in single line.
As it should. XML does not need any special formatting, it's just "noise" to the parser as Ernie noted. Open it up in your browser or something that understands XML if you want to display it formatted but there's absolutely no reason to worry about building it like that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply