General XML format Carriage Return Line Feed CRLF

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
Nisusmage
Premium Member
Premium Member
Posts: 103
Joined: Mon May 07, 2007 1:57 am

General XML format Carriage Return Line Feed CRLF

Post by Nisusmage »

I couldn't find any posts regarding this issue of the XML format coming out of the XML output stage.

The XML format I'm expecting is:

Code: Select all

<DEDUCTIONS>
      <DEDUCTION>
        <SURNAME>MCDONALD</SURNAME>
        <NAME>OLD</NAME>
      </DEDUCTION>
      <DEDUCTION>
        <SURNAME>MCDONALD</SURNAME>
        <NAME>NEW</NAME>
      </DEDUCTION>
</DEDUCTIONS>
Instead I'm getting:

Code: Select all

<DEDUCTIONS>
      <DEDUCTION>
        <SURNAME>
MCDONALD
        </SURNAME>
        <NAME>
OLD
        </NAME>
      </DEDUCTION>
      <DEDUCTION>
        <SURNAME>
MCDONALD
        </SURNAME>
        <NAME>
NEW
        </NAME>
      </DEDUCTION>
</DEDUCTIONS>
Has anyone figured out how to change the format of the XML Output stage to follow these rules?

Thanks in advance.
~The simpliest solutions are always the best~
~Trick is to understand the complexity to implement simplicity~
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why do you think you need that format? Parsers don't care, only people do. You have two choices with the stage: unformatted (aka 'one long line') or formatted as you've shown you are getting. We stick with unformatted out of the gate and only 'pretty' it when people need to look at it.

For that, you'll either need a command line 'pretty print' tool (which is what the output you are expecting is called) or you'll need to roll your own. Or just let something like XML Spy pretty the one-offs for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nisusmage
Premium Member
Premium Member
Posts: 103
Joined: Mon May 07, 2007 1:57 am

Post by Nisusmage »

Good Point ..

I was trying to format it for the human eye.

thanks for the input.
~The simpliest solutions are always the best~
~Trick is to understand the complexity to implement simplicity~
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

....or just exclusively open it via IE for human consumption. It's nearly always "pretty" there because it parses it correctly.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good Point .. :wink:

Any idea what kind of file sizes IE can handle?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nisusmage
Premium Member
Premium Member
Posts: 103
Joined: Mon May 07, 2007 1:57 am

Post by Nisusmage »

I changed the format to unformatted in datastage and used MS Visual Studio to reformat it.

Code: Select all

Edit -> Advanced -> Format Document. Save. 
Worked wonders. IE is very slow rendering XML. And I needed it in a clean format quickly for me to see that what I was getting was correct. I found VS 2005 much faster to open and reformat.

G
~The simpliest solutions are always the best~
~Trick is to understand the complexity to implement simplicity~
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea:
If you can figure out how to do that from a command line, you can fire up that command as an after-stage or after-job subroutine.
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