W3C home > Mailing lists > Public > www-validator@w3.org > December 2004

Possible bug in markup validator

From: White Lynx <whitelynx@operamail.com>
Date: Wed, 22 Dec 2004 18:23:42 +0400
To: www-validator@w3.org
Message-Id: <20041222142343.9DFBB23EE65@ws5-4.us4.outblaze.com>

Recently I tried to extend XHTML with several custom elements and noticed one validation related problem.
Consider this test page:

 <?xml version="1.0"?>
 <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
[<!ENTITY % Misc.class "| myElement"><!ELEMENT myElement (#PCDATA)>
 <!ATTLIST myElement xmlns CDATA #FIXED "http://mynamespace.me">]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Compound document</title>
</head>
<body>
<myElement>Content</myElement>
</body>
</html>

myElement is added to XHTML 1.1 Miscellaneous content model and thus it is allowed (almost) anywhere in XHTML document. However W3C markup validator rejects it 
"document type does not allow element "myElement" here".
Now if you slightly modify DTD and rewrite previous sample as follows then document validates:
<?xml version="1.0"?>
<!DOCTYPE html [
<!ENTITY % Misc.class "| myElement"><!ELEMENT myElement (#PCDATA)>
<!ATTLIST myElement xmlns CDATA #FIXED "http://mynamespace.me">
<!ENTITY % xhtml SYSTEM "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> %xhtml;]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Compound document</title>
</head>
<body>
<myElement>Content</myElement>
</body>
</html>

The problem is that these two DTDs are basically the same
(in one case XHTML 1.1 DTD is embedded as external DTD in second case it is embedded as external entity) so I assume that they should be handled identically by XML parsers (both samples are valid). I don't understand why W3C validator fails to validate first sample. Is it known bug or do I miss something?
-- 
_____________________________________________________________
Web-based SMS services available at http://www.operamail.com.
From your mailbox to local or overseas cell phones.

Powered by Outblaze
Received on Wednesday, 22 December 2004 14:25:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:16 GMT