[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XSLT containing javascript code with '<'

Subject: [xsl] XSLT containing javascript code with '<'
From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
Date: Sat, 11 Feb 2012 20:58:51 +0100

This is the essential part of what I have (after some research):

<xsl:stylesheet version="2.0"

<xsl:output method = "html" cdata-section-elements="script" encoding =
"UTF-8" indent = "yes"/>

<xsl:template match="/">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script type="text/javascript"><![CDATA[
function restore(){
   if( 1 < 10 )  alert("x");  // something else in reality.

However, the output from Saxon 9 (latest) contains
    if( 1 &lt; 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.

Any ideas?

Current Thread