Re: clean XHTML : what's new?

* "philippe barthelemy" <philippe.barthelemy@bdesign.fr> wrote:
| XTML requires a CDATA section within a <script> block,

Thats not correct. XML does not know content model CDATA for Elements, so the
content of a script element is interpreted as markup. To keep the script
readable, one could use a CDATA section, but there is no must to do so, you
can use

  if (a &lt; b)

too. Further, this is only necessary if the script includes characters, that
need to be escaped.

The problem is, that current browsers don't know CDATA sections and ignore the
script completly. I've suggested the following to get around this:

  <script type="text/javascript">
  <!-- --> <![CDATA[ /> <!--

    for (var i=0; i < 10; i++) { ... }

  // --> <! ]]>
  </script>

Tidy should offer an option to extract the script and put it into a seperate
file.
--
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981ASK ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://learn.to/quote [!]e
  "Everything we see or seem is but a dream within a dream" - E.A. Poe

Received on Thursday, 14 December 2000 15:06:18 UTC