XML File 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
beaulie01
Premium Member
Premium Member
Posts: 6
Joined: Wed Oct 01, 2003 9:24 am

XML File Format

Post by beaulie01 »

Hi,

I try to understand how the XML Output Stage works, and I have this problem.

This is the output I'm able to generate:

<directory>
<customer name="Acme">
<division>
Toys
</division>
<city>
Boston
</city>
<city>
New York
</city>
</customer>
<customer name="Acme">
<division>
Chemical
</division>
<city>
Raleigh
</city>
<city>
St-Louis
</city>
</customer>
</directory>

and this is what I want to generate:
<directory>
<customer name="Acme">
<division>Toys</division>
<city>Boston</city>
<city>New York</city>
</customer>
<customer name="Acme">
<division>Chemical</division>
<city>Raleigh</city>
<city>St-Louis</city>
</customer>
</directory>

Please help me.
Thanks
Eric
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

These are exactly the same. XML is, by definition, free format.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
beaulie01
Premium Member
Premium Member
Posts: 6
Joined: Wed Oct 01, 2003 9:24 am

Post by beaulie01 »

Ray,

So if I understand well, there is nothing I can do? It's because I want to reduce the volume of my XML output file.

Thanks! :D
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can't specify that in a XML stage. But you could write relatively simple job which reads each line and adds it to an output buffer, which is only written when you get a an XML terminator "</{name}>". This would be just one transform stage and a stage variable.

If I could program in awk or sed I think it would be a 1-liner there as well. Or you could run it through one the of freely available XML reformat programs and have it do this for you.
anntaylor
Participant
Posts: 24
Joined: Tue May 10, 2005 5:17 pm

Post by anntaylor »

You could also remove the checkmark beside the "Generate Formatted Output" in the XML stage. This will condense the output, though it will condense it more than the XML you have above.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

beaulie01 wrote:Ray,

So if I understand well, there is nothing I can do? It's because I want to reduce the volume of my XML output file.

Thanks! :D
Your volume won't change (apart from a few line terminators) - you have exactly the same amount of XML in both formats.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply