OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: Which elements can be root elements?

[ Lists Home | Date Index | Thread Index ]
  • From: "Simon St.Laurent" <simonstl@simonstl.com>
  • To: xml-dev@lists.oasis-open.org
  • Date: Fri, 23 Jun 2000 18:44:38 -0400

At 03:42 PM 6/23/00 -0400, DuCharme, Robert wrote:
>It's not the DTD's job to specify a document's root element; it's the
>doctype declaration's job. This flexibility is a Good Thing--it's the reason
>that XML (and SGML) have lent themselves so well to electronic publishing
>systems in which different elements were mixed and matched to create
>different documents all conforming to the same DTD.

There are some cases where it may in fact be useful to indicate which
elements are plausible root elements, though I'm not sure that enforcing
such restrictions harshly is necessarily a Good Thing.

The primary case I'm thinking of is DTD-based editing, where it typically
makes sense to use a limited set of element types as root elements.  Having
some way to indicate 'this is a likely root' can reduce the number of
option hurled at a novice user just trying to get started.

The other case - more likely with schemas than with DTDs - would want more
enforcement.  In these cases, a 'lazy' application looks to a validator to
check over a much larger set of details about a document, expecting the
results that pass the validator to map to application structures without
much difficulty.  This can be made simpler by restraining the possible root

There are plenty of pros and cons.  I can't say I'm convinced that the XML
1.0 approach of letting documents identify their own root elements and
leaving such information entirely out of the DTD is the one true way,
though it's certainly flexible.

Simon St.Laurent
XML Elements of Style / XML: A Primer, 2nd Ed.
http://www.simonstl.com - XML essays and books

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS