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: "DuCharme, Robert" <Robert.DuCharme@moodys.com>
  • To: xml-dev@lists.oasis-open.org
  • Date: Fri, 23 Jun 2000 15:42:23 -0400

>  <!ELEMENT mydoc (head,body) >
>In the above case, a document author could always write a document
>directly to body.  

Assuming that you had developed an application to process mydoc documents,
why would they want to? If they want to write a whole new application that
isn't counting on any information (e.g. some attribute value) from the
parent of the body element, all that extra work is up to them. 

>From a practical standpoint, the highest level element type in a DTD is
often used as the document type, which has given some people the impression
that it has to be. 

>that would mean that validation to the DTD is an incomplete
>validation of the document. 

This twists the meaning of "validation." When I write a book using the
DocBook DTD, it's a completely valid document even though it's not part of a
set of books that point to that DTD, even though the DocBook DTD declares a
set element type that consists of one or more books. 

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.

>Does XML provide a embed another entire document into another document?  

There are general entities, but you can't used them to embed one document
that has a doctype declaration inside of another. SGML has something called
SUBDOC, but this was one of the features tossed out to make XML simpler than
SGML. Check out the W3C XInclude proposal, which will address this. 

Bob DuCharme          www.snee.com/bob           <bob@  
snee.com>  "The elements be kind to thee, and make thy
spirits all of comfort!" Anthony and Cleopatra, III ii

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