Subject: Re: 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 
 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 
 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('//<![CDATA[
',text(),'
//]]>')"/>
> </xsl:copy>
> </xsl:template>
|