Re: Problem in referencing DHTML 'document' object within <xsl:script>

Subject: Re: Problem in referencing DHTML 'document' object within <xsl:script>
From: Duane Nickull <webmaster@xxxxxxxxxxxxxxxxx>
Date: Wed, 14 Apr 1999 16:06:58 -0700
>From Duane Nickull:

The correct syntax for including a script in XSL is written below, with
accompanying notes which I would encourage everone to read.

For anyone wanting to look at a script embedded within an XSL document, 
you can view one I wrote at 

http://www.cartnetwork.com/xml/example.xml

XSL ONLY at:
http://www.cartnetwork.com/xml/example1.xsl

> 
> Have you tried to comment out the script part of your XSl file (see below)?
> 
> <xsl:script language="JScript">
> <xsl:comment>
> ----Your script code --------
> </xsl:cmment>
> </xsl:scrip>
<SNIP>

I would use this instead:

 <script><xsl:comment><![CDATA[
---your script goes here----
 ]]></xsl:comment></script>

Notes:  

<xsl:script> is a Miscrosoft proprietary tag and is not actually part of
the XSL rec at w3.org.  I use <script> in my xsl documents as a
substitute based on it probably being more compatible with other XML
browsers in the future(specifically NN 5.0)

By default, the language for the <script> tag is javascript and you're
right - I should probably get in the habit of using it myself but hey -
I'm just another lazy Canadian ;-p

CDATA will be parsed by the browser as opposed to not declaring CDATA in
which case the default for MSIE 5.0 will be PCDATA and *may* not be
parsed.  One MSIE 5.,0 beta I had did parse it, another didn't.  Who
knows???

Duane Nickull


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


Current Thread