[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Need to wrap XML in tags


Subject: Re: [xsl] Need to wrap XML in <![CDATA[...]]> tags
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Aug 2003 15:38:11 +0100

     <xsl:text disable-output-escaping="yes">
          &lt;![CDATA[

You don't want to produce "<!CDATA" taht is a linearisation issue that
will be handled by teh system.

You want to convert an element node into the string "<foo/>"
ie you need templates like
<xsl:element match="*">
&lt;<xsl:value-of select="nam()"/>&gt;
  <xsl:apply-templates/>
&lt;/<xsl:value-of select="nam()"/>&gt;
</xsl:element>

There are more complete stylesheets doing this in the archives of this
list and the faq.

then if for some reason you want your person element to use CDATA
section markup, specify 
cdata-section-elements="person"
on xsl:output.

You don't (ever, almost) want to uuse disable-output-escaping. It looks
as if your system doesn't support it anyway, given the output you
showed. (It might not support cdata-section-elements either, but at
least if that is ignored the result will be equivalent to te result you
asked for, even if using a different markup.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread