- From: fantasai <fantasai@escape.com>
- Date: Wed, 04 Dec 2002 22:47:11 -0500
- 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 UTC