[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Outputting Formatted XML within HTML using XSLT
Hi, folks, I'm trying to output a block of XML from an XSLT that uses the HTML output method for the rest of the page. I figured some combination of xsl:text and CDATA section would work, but I must be missing something. The relevant parts of the XSLT follow. This almost is what I want, but I want the XML to be displayed with the original formatting. Suggestions much appreciated. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="html"/> {templates outputting HTML table not shown.} {fragment where XML output is needed:} <xsl:text disable-output-escaping="no" xml:space="preserve"><![CDATA[ {a bunch of XML nested content here} ]]> </xsl:text> For example, if the XML fragment is: <ELT1 attr1="value"> <ELT2 attr2="value"/> <ELT3 attr3="value" attr4="value"/> </ELT1> The above XSLT produces: <ELT1 attr1="value"><ELT2 attr2="value"/><ELT3 attr3="value" attr4="value"/></ELT1> instead of literally quoting the XML. Thanks in advance for any help. Ken Sall sallk@xxxxxxxxxxx SAIC
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|