xsl-list
[Top] [All Lists]

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

2008-10-22 18:00:52
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(_at_)gmail(_dot_)com> 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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--