[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Define a root in a DTD
- From: Bob DuCharme <email@example.com>
- To: firstname.lastname@example.org
- Date: Wed, 27 Jun 2001 10:10:05 -0400
> When fragmenting an XML file, every fragment is likely to have a
> different root.
Actually, I wouldn't say "likely," because I picture a book document being
fragmented into a series of chapter documents, but maybe I'm one of those
old SGML document-centric centric types I keep reading about.
> However, every fragment should also be valid against the
> superstructure document type (so need to share the dtd).
> Explicitely defining a root element forbids fragmentation. Or am I
> mistaken by fragmentation ??
You've got it right. And it's even better when you're working the other way,
i.e. the assembly of fragments into larger documents. By letting each
fragment (via the DOCTYPE declaration) pick whatever element type in a DTD
it wants to use as a document element, each one can be assembled and edited
using the DTD to ensure validity, and they can then be combined into one
document that is still valid against the same DTD. (The combination can't
have all the DOCTYPE declarations from all the pieces, and must have only
one at the top, but that's another issue.)
One more point on the forbidding of fragmentation: it's nice to hear that
RELAX NG does let you specify which element type will serve as a root, but
doesn't force you to, so that we can all have it both ways. According to
James' posting, you can define several element types as potential roots, so
you can still have fragmentation and prevent people from creating documents
based on any old element type in the schema.
Bob DuCharme www.snee.com/bob <bob@
snee.com> see http://www.snee.com/bob/xsltquickly for
info on new book "XSLT Quickly" from Manning Publications.