[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Content of Script element getting wrapped by CDATA
Subject: Re: [xsl] Content of Script element getting wrapped by CDATA From: "Joyce Babu" <joyce@xxxxxxxxxxxxx> Date: Thu, 23 Oct 2008 14:48:11 +0530 |
It did work. Here is the final working code <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes" indent="no" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> <xsl:template match="/"> <html xml:lang="en" lang="en"> <!-- Include Header--> <xsl:apply-templates select="/head" /> <body> </body> </html> </xsl:template> <xsl:template match="script"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:value-of disable-output-escaping="yes" select="concat('//<![CDATA[
',text(),'
//]]>')"/> </xsl:copy> </xsl:template> <xsl:template match="style"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:value-of disable-output-escaping="yes" select="concat('<![CDATA[
',text(),'
]]>')"/> </xsl:copy> </xsl:template> <!--Identity Transform--> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <!--xsl:apply-templates select="node()"/--> </xsl:copy> </xsl:template> <xsl:template match="@*|text()|comment()|processing-instruction()"> <xsl:copy/> </xsl:template> </xsl:stylesheet> I wrote a separate template for style, since I don't think the single line comment (//) is not supported by css. Thanks a lot for helping me with this. Joyce
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Content of Script element, Joyce Babu | Thread | Re: [xsl] Content of Script element, Joyce Babu |
Re: [xsl] Content of Script element, Joyce Babu | Date | Re: [xsl] Grouping: unordered lists, Michael Ludwig |
Month |
Keywords