Extending DTDs for Backward Compatibility

Rick Jelliffe ricko at allette.com.au
Fri Jan 30 14:58:34 GMT 1998


 
> From: Joe Lapp <jlapp at webmethods.com>

> >I need to create DTDs that are extensible...

The base DTD:

 <!--  Base DTD in file x.dtd -->
 <!ENTITY % x.addon " " >
 <!ELEMENT x  ( #PCDATA | table | chair %xaddon; ) >
 ...

In the document:

 <!DOCTYPE x SYSTEM "x.dtd"
 [
 <!ELEMENT Joes-new-extension-element ( #PCDATA ) >
 <!ENTITY % x.addon " | Joes-new-extension-element ">
 ]>

 <x>some text<Joes-new-extension-element/> some other
 text</x>

Parameter entities in the "internal subset" of the
Doctype declaration are parsed before the "eternal
subset" (i.e. x.dtd here).

The first declaration of an entity has precedence.

So you can derive a new DTD by merely declaring the new
element types you need in the internal subset, and then
defining the appropriate parameter entity.


Rick Jelliffe
 

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




More information about the Xml-dev mailing list