Re: [xsl] Fw: <script> tag

Subject: Re: [xsl] Fw: <script> tag
From: Goetz Bock <bock@xxxxxxxxxxx>
Date: Mon, 1 Oct 2001 18:11:07 +0200
On Mon, Oct 01 '01 at 16:41, Luís Camacho wrote:
> My question is: should the <script> tag mean anything for a XSLT parser?
This is just an educated guess, but you're using html as output format?
<xsl:output method="html" />

In this case your xslt processor, of cause knows how to do html, and
script has a special meaning in html.

> Stylesheet:
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> 
> <xsl:output method="xml" cdata-section-elements="script"/>
> <xsl:template match="/">
>   <script language="javascript">alert("&lt;&gt;")</script>
>   <script2 language="javascript">alert("&lt;&gt;")</script2>
> </xsl:template>
> </xsl:stylesheet>
> 
> Result:
> <script language="javascript">alert("<>")</script><script2
> language="javascript">alert("&lt;&gt;")</script2>
> 
> Note that my intended result is the one relating to the script2 tag.
The <script ...> resutl is proper html. <script2 ...> is no html, but
the output is wrong.

To get your result:

<xsl:template match="/">
  <script language="javascritp">alert("&amp;lt;&amp;gt;")</script>
</xsl:template>  

-- 
Goetz Bock                                              IT Consultant
Dipl.-Inf. Univ.

Attachment: pgp00001.pgp
Description: PGP signature

Current Thread