SGML and Exceptions

The Standard Generalized Markup Language (SGML) allows users to define document type definitions (DTDs), which are essentially extended context-free grammars in a notation that is similar to extended Backus-Naur form. The right-hand side of a production is called a content model and its semantics can be modified by exceptions. We give precise definitions of the semantics of exceptions and prove that they do not increase the expressive power of SGML. For each DTD with exceptions we can construct a structurally equivalent extended context-free grammar. On the other hand, exceptions are a powerful shorthand notation—eliminating them may cause exponential growth in the size of a DTD.