W3C home > Mailing lists > Public > www-html@w3.org > December 2002

Re: escaping escaping

From: fantasai <fantasai@escape.com>
Date: Wed, 04 Dec 2002 22:47:11 -0500
Message-ID: <3DEECC3F.70807@escape.com>
To: www-html@w3.org

David Woolley wrote:
>>  The XMP element works just like I want it to, but I haven't seen that 
>>element in a spec... hmm... ever?  Its been awhile, at least.
> 
> 
> That's because it's impossible to specify in an SGML DTD.  It's a hack.

It *is* possible to specify <xmp> in an SGML DTD. (Whether it can
contain HTML code is a different matter. [1]) SGML DTDs can specify
element content to be CDATA, and that's exactly how <xmp> is defined.
[2] HTML 4.0 defines <script> and <stylesheet> as CDATA elements.
This is why most markup constructs are not recognized within these
elements--why '<' and '&' don't need to be escaped in embedded
scripts and why apparently commented out code may not be thrown out
by the parser. [3]

[1] http://www.flightlab.com/~joe/sgml/cdata.html#SECT6
[2] http://www.ietf.org/rfc/rfc1866.txt Section 5.5.2.1.
[3] In
       <stylesheet type="text/css">
         <!-- h1 {text-align: center} -->
       </stylesheet>
     The entire string
         <!-- h1 {text-align: center} -->
     gets passed to the CSS parser.
Received on Wednesday, 4 December 2002 22:46:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:53 GMT