Re: [xsl] Content of Script element getting wrapped by CDATA

Subject: Re: [xsl] Content of Script element getting wrapped by CDATA
From: "Darcy Parker" <darcyparker@xxxxxxxxx>
Date: Wed, 22 Oct 2008 18:00:23 -0400
FYI:

In the comment in the template below, I meant to say:

<!--Note: The &#xA; characters at the end of the CDATA start tag and
before the CDATA end tag are important because the script text may
*NOT* begin and end with new lines.-->

Darcy
On Wed, Oct 22, 2008 at 5:55 PM, Darcy Parker <darcyparker@xxxxxxxxx> wrote:
>     <xsl:template match="script | style">
>          <xsl:copy>
>               <xsl:apply-templates select="@*"/>
>               <!--Note: The &#xA; characters at the end of the CDATA
> start tag and before the CDATA
>                                             end tag are important
> because the script text may begin and end with new lines.-->
>               <xsl:value-of disable-output-escaping="yes"
>
> select="concat('//&lt;![CDATA[&#xA;',text(),'&#xA;//]]&gt;')"/>
>          </xsl:copy>
>     </xsl:template>

Current Thread