xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <ke...@ad1440.net>
Subject Re: Yet another question about creating a Document
Date Wed, 08 Nov 2000 22:58:00 GMT
> Then I totally misunderstand doctype.  I have lots of
> XML documents with a root element with a different
> name from the doctype.

Then you must have a lot of invalid documents.  :-)

> Why would the root element have to be named after the
> doctype?

It's in the XML spec, section 2.8: "The Name in the
document type declaration must match the element type of
the root element."

OK, you're not looking for a flip answer, but I'm afraid
that's all I've got.  It might be a leftover from early
SGML parsers that couldn't figure out how to look ahead
to see what the root element was and then see if it was
a valid element in the DTD---but that's just a guess.

Take care.
--Sean




Mime
View raw message