I need to generate an XML file, where
- each line is a properly formatted XML document
- each line is terminated by the appropriate new line char
I spoke with an Ascential rep and was told that this requirement wasn't normal. He suggested using an XML chunk and perhaps having a "pass through" field that had the appropriate new line char in it. I tried this, but apparently wasn't successful.
Anyone have any ideas?
Thanks,
Tony Stark
XML question
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If the XML document in each line isn't too long, perhaps a DIY approach where you have a Sequential File stage writing a single column that contains the document, the document having been produced by an expression in a preceding Transformer stage?
(An obviously quick response without a lot of thought about alternatives - I'm in an airport lounge right now (no surprise!).)
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
(An obviously quick response without a lot of thought about alternatives - I'm in an airport lounge right now (no surprise!).)
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Can you output each XML document individually through a DataStage job into a directory then concatenate them into a single file. A Unix/Windows script would append each XML document to a master file with a return character. It is called as an after job routine so the master XML file gets appended to as each XML document is created.
Vincent McBurney
Data Integration Services
www.intramatix.com
Vincent McBurney
Data Integration Services
www.intramatix.com
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
Ray and Vincent, thanks for your replies.
(me putting on my stupid hat)[:D]
I figured it out.
Problem 1 was that I didn't understand that I would essentially have one field coming out of the XML Output stage containing all the XML for one row.
Problem 2 was that I needed an output link from the XML Output stage to a sequential file stage, not writing to a file directly from the XML Output stage.
Problem 3 was that the XML Output stage needed the Output Mode on the Transformation Settings tab (on the Output tab) set to Single Row, not Aggregate all rows (the default).
Once I figured out these three things, it was a piece of cake.
Thanks again for your time and your replies.
Tony
(me putting on my stupid hat)[:D]
I figured it out.
Problem 1 was that I didn't understand that I would essentially have one field coming out of the XML Output stage containing all the XML for one row.
Problem 2 was that I needed an output link from the XML Output stage to a sequential file stage, not writing to a file directly from the XML Output stage.
Problem 3 was that the XML Output stage needed the Output Mode on the Transformation Settings tab (on the Output tab) set to Single Row, not Aggregate all rows (the default).
Once I figured out these three things, it was a piece of cake.
Thanks again for your time and your replies.
Tony