xml output in one line

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

xml output in one line

Post by swades »

Hi Friends,
I've created several XML documents using XML stages in DataStage.

When I viewed the files in the vi editor the XML tags are on separate lines as follows:

<BEGIN_DATE>
09/25/2006 12:00:00 AM
</BEGIN_DATE>
<END_DATE>
09/24/2006 12:00:00 AM
</END_DATE>

but it should be like
Good morning, folks. I've created several XML documents using XML stages in DataStage.

When I viewed the files in the vi editor the XML tags are on separate lines as follows:

<BEGIN_DATE>09/25/2006 12:00:00 AM </BEGIN_DATE>
<END_DATE> 09/24/2006 12:00:00 AM </END_DATE>

Please help me out on this.
thanks and appreciated in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You've got two choices with XML in DataStage out of the box: you can generate 'formatted output' or leave it unformatted.

Formatted is what you've shown in your first example. It is more for people rather than processes as automated processes don't care about formatting aka 'pretty printing'. Personally I haven't found anyone that likes the way DataStage formats the output.

Unformatted is where the entire file is basically one long record.

If you want something else, a different 'flavor' of formatting, you have two choices as far as I know:

1) Use an XML Transformer with a custom stylesheet you provide.

2) Generate unformatted output and then 'pretty print' it as a separate step after the job completes.

We went with option #2. Option #1 is documented in that 'XML Designer' pdf document in your Docs directory, from what I recall.
-craig

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