XSLT put Root node into a string element of the Target Schema

fernandohawk

New Member
I'm having much difficulty trying to resolve an issue I am facing. We have a source XML Schema that we are using XSLT to transform to a Target Schema. However one of the elements in the Target Schema is designed to hold the raw XML from the source XML (including atributes). I do not wish to use CDATA as that will cause issues when the data is being consumed again. I'm running this XSLT in BizTalk 2009 so I will be limited only to using XSLT 1.0/XPATH 1.0. Oh, and to complicate things just a little further, the data in the source XML has < and > in some of the elements.Source Example:\[code\]<root><foo company="1"> <bar id="125" title="foobar3"> > 15 years</bar> <bar id="126" title="foobar4"> < 5 years</bar></foo><foo company="2"> <bar id="125" title="foobar3"> > 15 years</bar> <bar id="126" title="foobar4"> < 5 years</bar></foo>\[/code\]Example Target\[code\]<newXML> <Company>1</Company> <SourceXML><root> <foo company="1"> <bar id="125" title="foobar3"> ">" 15 years </bar> <bar id="126" title="foobar4"> "<" 5 years </bar> </foo> <foo company="2"> <bar id="125" title="foobar3"> ">" 15 years </bar> <bar id="126" title="foobar4"> "<" 5 years </bar> </foo></root> </SourceXML></newXML>\[/code\]
 
Back
Top