On 26.06.2018 13:38, Willem Van Lishout willemvanlishout@xxxxxxxxx wrote:
Hi,
Ibm required to produce an XML file like this using XSLT 1.0:
<?xml version=b1.0b?>
<root>
<element>
B B B <?xml version="1.0" encoding="utf-16"?>
B B B B B <AXFRoot>
B B B B B B B <MAObject type="default" mdclass="EPISODE">
B B B B B B B B B <GUID dmname="">595233000</GUID>
B .....
B </element>
</root>
So basically I have to put a string-encoded XML structure inside another
XML. While I'm sure this is theoretically possible by just using
<xsl:text>, this does not seem like a sustainable way of working with
long and deep structures.
Is this possible without resorting to 'heavier' programming solutions?
Evan Lenz has a quite sophisticated XSLT 1.0 stylesheet to "serialize"
XML to a string http://lenzconsulting.com/xml-to-string/
If XSLT 2.0 or 3.0 can offer a solution I'd also like to hear.
In XPath 2.0 you can use
<element>
<xsl:value-of select="unparsed-text('foo.xml')"/>
</element>
or in XPath 3 the serialize function that Mike has already posted.
|