Subject: Re: [xsl] XSLT containing javascript code with '<' From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sun, 12 Feb 2012 12:33:36 +0100 |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method = "html" cdata-section-elements="script" encoding = "UTF-8" indent = "yes"/>
<xsl:template match="/"> <html> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <head> <script type="text/javascript"><![CDATA[ function restore(){ if( 1< 10 ) alert("x"); // something else in reality. } ]]></script> <title>X</title> </head> <body> </body> </html> </xsl:template> </xsl:stylesheet>
However, the output from Saxon 9 (latest) contains if( 1< 10 ) alert("x"); which Chrome refuses to accept as correct javascript, and I think it is right.
Omitting cdata-section-elements="script" doesn't alter anything, of course.
Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT containing javascrip, Andrew Welch | Thread | Re: [xsl] XSLT containing javascrip, David Carlisle |
Re: [xsl] XSLT containing javascrip, Andrew Welch | Date | Re: [xsl] XSLT containing javascrip, David Carlisle |
Month |