6 Extending the DTD

For a particular document, it may be desirable to slightly modify or extend the DTD. You can do this by defining input.local as a SYSTEM entity referring to a file containg the required definitions. This file is read after the generic attribute entities have been declared, but before the remaining entities having to do with content models.

Thus the file can contain declarations for additional elements that can take advantage of the generic attribute entities, and it can override the content model parameter entities if necessary (this is because the 1st declaration of an entity wins, subsequent declarations for the same entity are ignored).

Normally, at the most, you should consider adding some phrasal elements. This can be done simply by defining parameter entity p.mix.local:

<!ENTITY % p.mix.local "| foo | bar">

Note the leading vertical bar: it is required because p.mix.local is concatenated to the end of a disjunction of elements.

The typical way to extend the DTD is to place your declarations in a file, say myaddons.sgml, which may also contain a definition of p.mix.local as shown above. Then your document should use a DOCTYPE header of the form:

<DOCTYPE BOOK SYSTEM "ozdoc.dtd" [
<!ENTITY % input.local SYSTEM "myaddons.sgml">

Denys Duchier
Version 1.4.0 (20080702)