Design thoughts for DITA 1.2 Language Reference

Common use cases that are not possible with the DITA 1.1 language reference:

  1. The contains/contained by sections change with every doctype. Including a static version is a) misleading for readers of the spec because it implies an inflexible model, and b) difficult for specializers to work with. I want to reuse the spec documents that define each element, but have my users find correct contains/contained-by information that includes my domain.
  2. For my applications, I need to add statements of support for a few elements. I want that information to appear in a logical spot my local copy of the spec.
  3. I would like my copy of the spec to include additional examples that highlight local best practices.
  4. I have specialized attributes, so my local copy of the spec needs those added.
  5. ...any other use cases...?

Proposed Design

Take advantage of both keyref and conref push/replace, which are new DITA 1.2 features, as well as a standard template for defining elements in the spec. Specifically:

Now that everyone is fully confused

Here is a sample of how this could work. The template for each element would be:

<reference id="element-name">
  <title>element-name</title>
  <shortdesc>Description of the element</shortdesc>
  <refbody>
    <!-- Additional description, if needed -->
    <section id="contains">
      <title>Contains</title>
      <p>The content model of this element may differ based on where it is used.
         Content model information is located here: <xref keyref="element-name-contains"></xref></p>
    </section>
    <section id="containedby">
      <title>Contained By</title>
      <p>The parents of this element may differ based on where it is used. Content model
         information is located here: <xref keyref="element-name-contained-by"></xref></p>
    </section>
    <section id="inheritance">
      <title>Inheritance</title>
      <p>- topic/element</p>
    </section>
    <example id="example"> example here </example>
    <section id="attributes"> 
      <simpletable id="attribute_table"> ... </simpletable>
    </section>
</reference>

Technical specifics

For reference, the description of Conref Push and Conref Replace is here: http://www.oasis-open.org/committees/download.php/26290/IssueNumber17e.html

Linking to contains/contained-by

The contains/contained by information will be generated as it is today. It is generated as an appendix (may be one file or many depending on the scenario). Each topic will contain a keyref with the format of "element-name-contains"; that key will be defined in the map as a link to the proper topic in the appendix. Formatters may chose how to render this information; the default OASIS distribution would likely be a simple link, but another implementation could render the information as pop-up help.

Adding implementation info

Every element will have a section with id="contains" following the description of the element. Conref push may be used to insert a new section with tool specific information before #element-name/contains (so it appears immediately after the standard description).

Adding examples

Every element will have an example, with id="example". Conref push may be used to insert additional example elements either before or after the common example.

Attribute updates

This is the trickiest item to work with. The attribute table and the section that contain it each contain a standard ID. If the revised set of attributes are always common (every instance of that element has the same attribute set), then "conref replace" may be used to replace the actual attribute table. If the attributes differ, such that an element has some attributes in one document type but others in a second document type, then conref replace may be used to replace the entire section. The new section can include a single attribute table with additional explanatory information, or multiple attribute tables, or a link to external information (similar to the contains and contained by sections).

Questions

Language Specification Design (last edited 2008-04-04 23:58:42 by robander)