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

Re: Preventing tags from collapsing

Subject: Re: Preventing tags from collapsing
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 15 Apr 2005 10:56:50 +0100
coll david
  I inserted an html comment:

  <script ...><!--Leave this here to solve and IE bug--></script>


If you do that in an HTML file (rather than an XHTML File) you are
relying on bugs "or quirks compatibility mode or whatever you want to
call it"

<script> in HTML  is a normal element with PCDATA content so within such
an element <!--Leave this here to solve and IE bug--> is a comment, and
will be ignored.

However in HTML <script> is a CDATA element (an element type that does
not exist in XML) which means that < inside script is _not_ takken as a
start of markup unless it is followed by /script>  which means you can
write 
a , b in your javascript but also means 
<!--Leave this here to solve and IE bug-->
is _not_ a comment it is a string of text in the element content and in
a conforming system would be passed  as part of the element content to
the script interpretter which would then report a script error.
The fact that your browser doesn't do that and filters out this text as
it "looks like" a comment is just typical browser behaviour working on
hueristics rather than implementing languages as specified.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.