Re: [xsl] : Problems with Javascript block / Netscape

Subject: Re: [xsl] : Problems with Javascript block / Netscape
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 17 Aug 2001 09:22:00 +0100
Hi Jeremy,

> I have some JavaScript in my XSL. (example below) This works fine
> with IE, but not with Netscape. The problem is that for instance
> this line here
>
>   for(i = 0; i < numAvail; i++){
>
> gets converted into this
>
>   for(i = 0; i &lt; numAvail; i++){
>
> IE can handle the change from "<" to "&lt;", but NS can't. Is there
> anyway to output these symbols in regular form?

It sounds as though you're outputting HTML, but not using the HTML
output method. The HTML output method should not escape less-than
signs in script elements. To use the HTML output method, do:

<xsl:output method="html" />

Chuck Evans' suggestion of putting the script in an external file and
referencing it is an even better solution if you're not generating
parts of the JavaScript on the fly.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread