[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problem with the use of JavaScript in a XSL file

Subject: RE: Problem with the use of JavaScript in a XSL file
From: "Martinez, Brian" <brian.martinez@xxxxxxxx>
Date: Wed, 5 Mar 2003 07:33:11 -0700
xsl comment javascript
> From: Andrew Welch [mailto:AWelch@xxxxxxxxxxxxxxx]
> Sent: Wednesday, March 05, 2003 5:45 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Problem with the use of JavaScript in a XSL file
> 
> > I need Help. I have a problem using the character "<"other ">" in a
> > javasript in a XSL file.
> 
> Hi,
> 
> Try wrapping script in <xsl:comment> and in a cdata section:
> 
>   <script>
>     <xsl:comment>
>       <![CDATA[
> 
> 
>       ]]>
>     </xsl:comment>
>   </script>
> 
> This will allow you to write javascript that doesnt bother 
> the xslt processor, and will wrap the script in <!-- --> in the ouput.

Not really an XSLT issue, but if you don't prefix the end comment tag with a
JavaScript comment delimiter, interpreters will treat it as a pre-decrement
operator, which can generate unexpected errors.  So the last line before the
end script tag should look like:

//</xsl:comment>

Could you put the comment tags (literal, not xsl:comment) inside the CDATA
block, or would that still cause the processor to ignore the contents?

In practice, I no longer see the point of wrapping script code in comment
tags.  IIRC, it's only needed for browsers that don't understand the script
tag (as opposed to not recognizing JavaScript, or having scripting disabled
via an option setting).  How many people are actually using such beasts
these days?

cheers,
b.

| brian martinez                              brian.martinez@xxxxxxxx |
| senior gui programmer                                  303.708.7248 |
| trip network, inc.                                 fax 303.790.9350 |
| 6436 s. racine cir.                             englewood, co 80111 |
| http://www.cheaptickets.com/                   http://www.trip.com/ |

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.