I understand the current output is good enough for any application that processes XML files. Be that as it may, I am still curious to find out if anyone has had any luck removing the new line in DataStage. I know that we can write sed commands to format. But I haven't found one that is generic, i.e., independent of tag names.
No offense meant by this, but it is simply not an answer, technique, or subject for discussion. Valid xml, by the "xml standards" (see w3c.org), considers CRLFs and extra blanks as "noise". About 10 to 12 years ago, being able to do pretty formatting was useful, because there weren't so many tools that understood it. But now, it should not be an issue. Read-ability (the only reason to consider different appearance), is better managed in nearly every editor and browser available on the market --- including color coding.
DataStage is about moving and transforming data....and any blanks just make that more difficult if the data volumes are large. You should not select the formatting option.
If you are being asked to do this, tell the one who is asking "no". ...and that they need to get themselves an alternate tool for reading the xml.
First question - why format it at all? It's not anything needed and if you want to see it formatted open it in something like IE. To pursue this, in your shoes I'd look into something like a 'pretty printing' utility you could call from the command line as a post-process that would output a formatted file that is more to your liking.
D'oh... too slow.
-craig
"You can never have too many knives" -- Logan Nine Fingers
This issue has also bugged me to. And I understand all the arguments that pretty XML isn't a requirement but unfortunately I have to work with submitting XML to other systems that suck and require pretty XML.
So just wanted to post my work around to getting pretty XML, unfortunately it involves human intervention, maybe one day I'll figure out a way to completely automate it.
Prerequisites:
Notepad++ with the XML Tools plugin installed
1. DataStage XML output without formatting all on a single line
2. Open file in Notepad++
3. Plugins > XML Tools > Pretty Print with line breaks