Using OASIS CALS Tables

Two Ways to Use OASIS CALS. There are two ways in which the OASIS CALS table model can be used with the NLM Suite. The simplest way is to use the OASIS CALS table model instead of the XHTML table model. Replace the module for the XHTML table and its setup module with the module for the CALS table and its setup module, and 95% of the work is done. The second way — where a publisher or archive wishes to support both table models — is slightly more complicated.

Table Context. Tables are not used directly in the NLM Suite tag sets; they are embedded in larger structures. The element <table> is embedded in <table-wrap>, which contains the label, caption, table footer, etc. for the table. The element <tbody> (a part of the table) is used within <array>.


Changes to the Modules

Whether the OASIS CALS table is to be added to an NLM tag set as the only table model or as an additional table model to a tag set that already contains the XHTML table tag set, the majority of the changes required in the NLM models and setup are very similar. However, if the two table models are used in one tag set, there will be namespace collisions; a practical solution is to add a namespace and namespace prefix to the OASIS elements. The discussion below assumes that this technique is the one chosen to integrate the OASIS table elements.

The following changes may need to be made to incorporate a new table model:


Class Changes

Classes are used to define where an element may be used. The class is defined as one or more elements, and then the class is used instead of the specific element names in content models. If only one table model is used in the tag set, it may not be necessary to change the default classes, but they should be checked to be sure.

Table Classes. The table element(s) are named in the %table.class; Parameter Entity and used in models and mixes as needed. In either the default-classes module or the DTD-specific class over-ride module, set %table.class; to one of the following values:

Tbody Classes. The <tbody> element is named in the %tbody.class; Parameter Entity and used in models and mixes as needed. In either the default-classes module or the DTD-specific class over-ride module, set %tbody.class; to one of the following values:

Other Classes and Models. Any given tag set may use the <table> and <tbody> elements in other classes and content models. Use global searches over your DTD modules (or the equivalent) to see if these elements are used anywhere else.


New Modules

OASIS CALS Table Model Addition. To include the OASIS CALS table model in the tag set:

XHTML Table Model Removal. Remember that it is possible to use both the XHTML and CALS models in the same tag set. But if the XHTML table model is not to be included in the DTD, perform the following:


One or Two <table> Models — Table Differentiation

If two table models are to be used in one tag set, it is convenient to namespace one of them (see Pseudo Namespace below). The two OASIS modules have been set up assuming this namespacing. Hence, if only the OASIS table model is to be used, it will not be necessary to add a namespace or namespace prefix to the OASIS elements, and the instructions in Only OASIS: Removing the Prefix may be followed.


Two Tables: The Pseudo Namespace

In order to use both the XHTML and OASIS CALS table models in the same tag set, it is necessary to give the OASIS elements a namespace, since there are known name collisions. (Actually either table model could be given a namespace, but since the XHTML is the default table model, the OASIS CALS model is considered the secondary model.) Since namespaces do not work well in the DTD world, this will require putting an actual prefix in front of each OASIS CALS table model element name as well as declaring the namespace and prefix. The element <table> will be named <oasis:table>, <tgroup> will be <oasis:tgroup>, etc.

To insert the namespace pseudo-attribute, add the following to the Article Attributes Parameter Entity (%article-atts;):

             %oasis.xmlns.attrib;

This namespace is declared in the OASIS Table Setup Module (%oasis-tablesetup.ent;) and should always be used on the <article> element.


Only OASIS: Removing the Prefix

If only one table model is to be used, it is not necessary to prefix the OASIS elements or to use the “xmlns” psuedo-attribute. If a tag set is built using only the OASIS model and not the XHTML model, the OASIS modules may be left intact. But a DTD designer will probably find it more convenient to make the following changes to the OASIS modules as delivered:

  • Namespace removal — Remove the Parameter Entity declaration for oasis.xmlns.attrib from the OASIS Table Setup Module and from the %tbl.table.att; declaration.
  • Prefix removal — Remove the prefix “oasis:” from all the elements mentioned in the Table Setup Module (%oasis-tablesetup.ent;) and in the OASIS module (%oasis-exchange.ent;) so that, for example, <oasis:row> becomes <row>.


The OASIS Setup Module and Customization

The OASIS Table Setup Module (%oasis-tablesetup.ent;) provides overrides to standard parameter entities used in the OASIS-Open exchange CALS table model and then invokes the OASIS-Open table exchange model module. This module should be read to ensure that no additional changes are needed.

Inside Table Cells. The %paracon; Parameter Entity sets up the content of a table cell (<entry>). This Parameter Entity, in turn, is set to the %inside-cell; Parameter Entity; consequently, the %inside-cell; Parameter Entity must be declared before the OASIS Table Setup Module is called. A default value for the Parameter Entity is established in the %default-mixes; module of the NLM Suite:

<!ENTITY % paracon      "#PCDATA | %inside-cell;"                    >

NLM Added Attributes. The NLM Suite has added several attributes to the <table> element:

Other Changes. If you want to further customize the OASIS CALS table model, modifications should be added to the OASIS Table Setup Module (%oasis-tablesetup.ent;).