The "<" inside your CDATA section is taken as a literal rather then markup.
This is why it is escaped as "&lt" when output. However, the html output
method should not escape the content of the script (and style) elements. This
is one of remaining minor deviations from the specification for the output.
Until we add this missing feature, please use the following:

<script>
<xsl:text disable-output-escaping="yes">
<![CDATA[
...
]]>
</xsl:text>
</script>

Regards,
Petr

Tim Watts wrote:

> Hi,
>
> There is a problem in the *Sablotron* Parser when using <![CDATA[
>
> In the header of the HTML files which I am creating with XSL I want to use
> javascript in the final comment tags.
>
> By using XSL
> <script type="text/javascript" language="javascript">
> <![CDATA[
> <!-- comments here -->
> <!--
> function someJavascript() {
>                 if (something) {
>                         thenDo.this();
>                 }
> }
> -->
> ]]
> <script>
>
> I get HTML
> <script type="text/javascript" language="javascript">
> &lt;!-- comments here -->
> &lt;!--
> function someJavascript() {
>                 if (something) {
>                         thenDo.this();
>                 }
> }
> -->
> <script>
>
> Rather than HTML
> <script type="text/javascript" language="javascript">
> <!-- comments here -->
> <!--
> function someJavascript() {
>                 if (something) {
>                         thenDo.this();
>                 }
> }
> -->
> <script>
>
> Tim Watts
> [EMAIL PROTECTED]

--
Petr Cimprich
Ginger Alliance
www.gingerall.com


Reply via email to