Re: Can root name in DOCTYPE be a XSD-validity thing?

"C. M. Sperberg-McQueen" <[email protected]> Fri, 15 Feb 2013 08:15:39 -0700
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
Just one slightly pedantic footnote:

On Feb 15, 2013, at 4:00 AM, Leif Halvard Silli wrote:

> A doctype such as=20
>   <!DOCTYPE TheDocumentElement SYSTEM "ID" [<!--bla, bla-->] >
> allows to verify
>=20
>  a) that the DOCTYPE declaration is internally valid,=20
>     namely, that its root/document name and the DTD=92s definition
>     of the root element type, are matching each others,
>  b) that the root/name part of the DOCTYPE declaration
>     matches the actual root element of the document (except that
>=20
> The b) part does not seem technically necessary since this check could=20=

> even be performed by checking the document/root element against the=20
> document/root element definition found in the DTD.

As they are defined by the XML spec, DTDs do not have any
mechanism (other than the name given in the document type
declaration) for identifying a particular element as the document
element in an instance.  It is this which allows a DTD to be used=20
to perform structural validation either on a complete document=20
(for example, a book or an encyclopedia) or upon individual=20
elements which may be stored and managed in separate=20
entities (for example, a chapter in a book or an encyclopedia=20
entry).

So I don't think the check you have in mind can be performed
solely on the basis of a DTD's internal or external subset -- it
requires the document type declaration.


--=20
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com=20
* http://cmsmcq.com/mib                =20
* http://balisage.net
****************************************************************