Ask Eric


Question?

We are paging a book for a university press client who is structuring the source data in 12083 (we're "partnering" on the project, meaning I'm having an ongoing dialog with them about the project). The person doing the file authoring/editing work has a fairly good handle on what he is doing, but has basically created a new DTD (with a new name) that incorporates all of his changes -- supposedly made in keeping with the conformity rules stated by the standard (although I have not yet scrutinized his alterations).

My question is this; Is it correct that modifications to the DTD are expressed in the DOCTYPE DECLARATION area, and are designed to "overwrite" the affected element/entity declarations in the main DTD body? I'm shaky in my understanding of this process, but from a brief example in one of the EPSIG newsletters, plus the annotated electronic 12083 references, I've come to assume this. I'd like some confirmation before advising my customer about this.

Answer

You are perfectly right. The recommended way to make changes to ISO 12083 is done by overwriting markup declarations in the doctype declaration subset of the DOCTYPE declaration.

To be precise, here are the complete instructions of what's allowed and what's not:

To be conformant to ISO 12083, a derived application should:

  1. use the reference concrete syntax (i.e. no element names longer than 8 characters). This provides a guarantee that most SGML software can be used to process conforming documents;
  2. declare user-defined elements in external parameter entities. This permits them to be easily located, and, if required, removed;
  3. identify use of ISO 12083 as a base by using the appropriate public identifier. This ensures any modifications will be separated from the original declarations;
  4. override parameter entities defined in ISO 12083 to specify different order and occurrence or to specify user-defined elements or attributes. The new definitions should precede the parameter entity reference to this International Standard;
  5. not allow user-defined elements to specify an alias of an element already defined in ISO 12083;
  6. follow consistent naming conventions found in the document type definitions of this International Standard when creating new elements or attributes;
  7. conform to ISO 8879 (SGML).

If the application is developed for interchange purposes, it is recommended that the DTD be registered following ISO/IEC 9070 (Registration procedures for SGML applications).

Some examples of modified and conforming ISO 12083 applications:

As a general rule, it is a good principle to design your applications so that documents conforming to unmodified ISO 12083 will parse with your modified DTD. This will at least allow you to import documents. It could be, for example, that a publisher needs to make some changes to the Article DTD that are for internal purposes. In this case the modified DTD would only be used in-house, while the external authors would use the unmodified DTD.

1. Modifying content models

The content model for citation elements in bibliography lists require a title element to be present. Suppose you want to make the title element optional in your application. There are two ways to achieve this in an ISO 12083 compatible way.

Authors (document creators) would follow conformance requirement d) and define a new parameter entity m.bib in which the title is made optional:

<!DOCTYPE article [
<!ENTITY % bib "author|corpauth|msn|sertitle|location
|date|pages|subject|othinfo"
-- bibliographic, date is the publication date -->
<!ENTITY % m.bib "(no?, title?,(%bib;)*)" -- bibliographic entry-->
<!ENTITY % article PUBLIC "ISO 12083:1994//DTD Article//EN">
%article;
]>
<article>

The first definition of m.bib in the doctype declaration subset (the part between [ and ]) will override the second definition found in the unmodified DTD. The definition of the parameter entity bib has to be redefined as it is referred to in the definition of m.bib. Note that on some systems the PUBLIC keyword and identifier have to be replaced by a SYSTEM keyword and pathname.

The second method would be to define a new DTD, say "myarticl". This DTD would contain the same entity declarations as above, plus a definition for the "myarticl" element:

<-- This is the myarticle DTD -->
<!ENTITY % bib "author|corpauth|msn|sertitle|location|date
|pages|subject|othinfo"
-- bibliographic, date is the publication date -->
<!ENTITY % m.bib "(no?,title?,(%bib;)*)" -- bibliographic entry -->
<!ENTITY % myart SYSTEM "pathname-of-myarticle-element-definition">
%myart;
<!ENTITY % article PUBLIC "ISO 12083:1994//DTD Article//EN">
%article;
<-- End of myarticle DTD -->

Here, an external parameter entity "myart" contains the element definition of myart, in accordance with conformance requirement b. In this case it would contain a single declaration:

<!ELEMENT myarticl - - (article) >

This DTD would be invoked as follows:

<!DOCTYPE myarticl SYSTEM "pathname-of-myarticle.dtd">
<myarticl>
<article>
etc...

The latter technique is convenient if there are a lot of modifications that have to be shared among a group of people. Modifying the ISO 12083 DTDs in this way makes it easy to see what was changed so that down-stream applications are easier to change.

2. Adding new elements

Adding new elements has to be done with care. They should be defined, and in many cases they require modifications to parameter entities to make sure they are included in some model group. If, for example, an element "editor" is required as part of the citation element, we should also modify the "bib" parameter entity:

<!DOCTYPE article [
<!ENTITY % bib "author|corpauth|msn|sertitle|location|date|pages
|subject|othinfo|editor"
-- bibliographic, date is the publication date -->
<!ENTITY % myelems SYSTEM "pathname-of-file-containing-private-elements">
%myelems;
<!ENTITY % article PUBLIC "ISO 12083:1994//DTD Article//EN">
%article;
]>
<article>

In this case the file containing private elements contains only one element declaration:

<!ELEMENT editor - - (#PCDATA) >

Note that conformance requirement prohibits the re-definition of elements that are already contained in ISO 12083. Were this allowed, it would be possible to make any DTD into an ISO 12083 conformant DTD.


Return to the EPSIG home page