W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2001

HTML output method, <script> element

From: Michael Kay <mhkay@iclway.co.uk>
Date: Fri, 2 Feb 2001 22:09:58 -0000
To: <xsl-editors@w3.org>
Message-ID: <000701c08d69$fb2d33e0$0100007f@oemcomputer>
Question arising from a user's bug report:

If you write

<xsl:output method="html"/>
<xsl:template match="/">
<script>
   write("<b> if (a &lt; b) </b>");
</script>
</xsl:template>

should the output be (a)

<script>
  write("<b> if (a < b) </b>")
</script>

or (b)

<script>
  write("<b> if (a &lt; b) </b>")
</script>

(Saxon's output is a muddled mixture of the two and it needs to be changed
to one or the other)

The spec says ".. should not perform escaping for the content of the script
.. element", which I think implies (a); but (b) seems more useful.

I told the user he should really be writing it as

<xsl:template match="/">
<script><![CDATA[
   write("<b> if (a < b) </b>");
]]></script>
</xsl:template>

but that doesn't really answer the question.

Mike Kay
Received on Friday, 2 February 2001 17:44:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT