Inheritance in XML

Ron Bourret rbourret at
Mon Apr 27 15:54:21 BST 1998

My thanks to everyone who participated in the semantics and XML-DEVIL posts for 
a most amusing Monday morning.  I get the list in digest form, so you can only 
imagine the cumulative impact of reading this all at once...

I'd like to answer a question Matthew Gertner asked last Monday.  (That was a 
week ago.  Remember?  Before Noam Chomsky and the lawyers from Chicago?)

> Having given this some more thought, I don't see any practical way to insert
> new content in the middle of an existing content model. Maybe someone
> cleverer than I has an idea about how this might be done (and whether it is
> really useful). In the meantime, one useful approach might be to at least
> enable new content to be added at the beginning of the base content model by
> adding a #BASECONTENT keyword which is replaced by the base content model in
> the derived element type description:

Extending an existing DTD by inserting new content in the middle is definitely 
useful.  Imagine that I had a simple DTD for books:

<!ELEMENT Book (TitlePage, TOC, Chapter+)>

Now I want to add a list of figures after the table of contents and before the 

<!ELEMENT Book (TitlePage, TOC, FigureList, Chapter+)>

I can't easily do this without insertion.

Note that a very simple way to do this is for my derived document to simply 
redefine the Book element.  In effect, the two (or more) DTDs are simply merged 
before normal processing, with the precedence for multiply defined terms going 
to definitions in the derived document.  Although this probably doesn't satisfy 
a lot of requirements for polymorphism, etc., it does satisfy Matthew's 
requirement in a later post, which I agree would greatly increase the 
applicability of XML.

> All I want is to be able to do is scoot over to the DTD repository site,
> check for a standard DTD for invoices, grab it, extend it with the two or
> three extra attributes and/or contained element types that I need and use it,
> while still being able to use any tools that are designed to work with the
> original invoice DTD. I truly believe that this is where XML will really
> start to fulfill its promise.

It is easy to imagine a large number of simple, useful DTDs: date/time, 
measurement, word definitions, travel itineraries, bibliographies, etc.

Has anybody working on the namespaces spec considered this sort of 
functionality?  It strikes me as being very close.

-- Ron Bourret

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list