[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Embedding XML in another XML

Subject: Re: Embedding XML in another XML
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jun 2018 11:50:29 -0000
Re:  Embedding XML in another XML
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  &lt;?xml version="1.0" encoding="utf-16"?&gt;
 B B B B B  &lt;AXFRoot&gt;
 B B B B B B B  &lt;MAObject type="default" mdclass="EPISODE"&gt;
 B B B  B B B B B B  &lt;GUID dmname=""&gt;595233000&lt;/GUID&gt;

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.


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.