XML File Output Format !

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
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

XML File Output Format !

Post by allavivek »

Hi All

I am working on generating XML Files and i have couple of issues.

I am using XML Output stage to generate files.

1. The output XML file after Job finished, i don't see the below header, i checked for different options to generate this but i couldn't find any. Any way to generate below header in XML Output stage ?

<?xml version="1.0" encoding="utf-8"?>

2. The generated output XML has tags and data as below.
<timestamp>
2015-02-13 13:35:21
</timestamp>
<sub-id>
9234
</sub-id>

How to generate in below format.

<timestamp>2015-02-13 13:35:21</timestamp>
<sub-id>9234</sub-id>

Thank You...
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

First, what kind of header are you getting?

Second, crlf and spaces are just noise in xml. Open them in your browser and both will look the same.

Dont get forced into a formatting requirement for xml. Tags are tags....with or without crlfs and spaces in the data...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Post by allavivek »

Hello Ernie

The header i am getting is below , "submission" is the root element.

<submission xmlns:ns1="http://www.xxxx.org/ns/2010/xxx/xxx" guid="" vendorid="19489">


Regarding format, my client is submitting xml files to external vendor and the tool which the vendor is using is complaining about the spaces before tags. Apparently the tool the vendor is using is not able to load the file. They are expecting the content to be as :

<org-id>2668</org-id>

instead of

<org-id>
2668
</org-id>

Thank You.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They shouldn't be expecting any formatting. Turn off the formatted output option you have on right now.
-craig

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