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

RE: Netscape7.1 bug or bad code?

Subject: RE: Netscape7.1 bug or bad code?
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Wed, 2 Jul 2003 08:03:05 -0600
netscape7.1
> From: David Carlisle [mailto:davidc@xxxxxxxxx]
> Sent: Wednesday, July 02, 2003 3:52 AM
> Subject: Re:  Netscape7.1 bug or bad code?
> 
> 
> 
> > the JavaScript isn't ignored in  Netscape Version 7.02.
> 
> I don't know but maybe market forces of keeping users happy 
> outweighed the
> logically correct behaviour of treating a comment as a comment...

This is OT, but the original reason for wrapping comment tags around
JavaScript (the code, not the script tags) was so that older browsers that
didn't understand <script/> wouldn't output the code as literal text.  Now
that every browser released over the past six or seven years is at least
script-aware, the need for comment tags has been eliminated.  Some
old-timers insist on using them, however.

BTW, this will cause problems in output:

<script>
  <xsl:comment>
    alert("This is a script");
  </xsl:comment>
</script>

This will be output as:

<script>
  <!--
    alert("This is a script");
  -->
</script>

which will break most JS interpreters because they will parse the close
comment tag as a decrement operator, then get confused by the right angle
bracket.  If you do this in XSLT, you have to add a JS comment delimiter
before closing the comment:

// </xsl:comment>

cheers,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.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.