Embed XML in another XML

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
pillip
Premium Member
Premium Member
Posts: 50
Joined: Thu Dec 10, 2009 10:43 am

Embed XML in another XML

Post by pillip »

i want to embed one xml into another.
I have been successful in creating the first xml by using '/' in the XML output stage. I put this in the sequential file and the xml got created fine. Now I want to embed this xml in start and end tags.
I used another xml output stage, but was unable to get the output fine. Kindly let me know what xpath expression i need to use to get the required output.

I have checked the best pratices document but could not find the solution for this. Please help

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You could do your "embedding" manually in a transformer, if literally all you need are "start and end tags".
Last edited by chulett on Thu May 27, 2010 6:03 pm, edited 2 times in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

No....look more closely, especially at the section that talks about building XML documents with multiple nodes...the whole technique is based on this premise....you build a chunk then include it later in a final XMLOutput Stage....the chunk gets the XML data element and the xpath positions it....it's in there.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

in my copy of the document, it's on page 38.....the "text()" is placed after the high level "container" element of the repeating unit after performing the lookup to get the chunk....

You should have data element of XML to prevent further escaping to occur on your recently built chunk.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
pillip
Premium Member
Premium Member
Posts: 50
Joined: Thu Dec 10, 2009 10:43 am

Post by pillip »

i have used the transformer after the first xml and concatenated start and end tags. But the output is getting truncated.

Can you advise on how to use another XML output stage.

The output of the first xml is an XML dataelement. Now I need to append start and end tags to it.

What Xpath expressions do I need to use for this in the second XML output stage.

Thanks.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Find the full zip file for XML best practices. Do the exercises. Spend time with them. You will learn how it is done. I've pointed you to the section and the page number where this is illustrated. There isn't much more I can suggest.
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 »

Kim Duke's website in the DS Tips section.
-craig

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