On 26.06.2018 13:38, Willem Van Lishout willemvanlishout(_at_)gmail(_dot_)com
wrote:
Hi,
I’m required to produce an XML file like this using XSLT 1.0:
<?xml version=”1.0”?>
<root>
<element>
<?xml version="1.0" encoding="utf-16"?>
<AXFRoot>
<MAObject type="default" mdclass="EPISODE">
<GUID dmname="">595233000</GUID>
.....
</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.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--