How to assign meaning to the elements of arbitrary DTDs
Many SGML applications face the problem of understanding the semantics that should be attached to elements in any arbitrary DTD.
Alternatives
- Style sheets: vendor-specific syntax usually focused on presentation and formatting
- Custom DTDs or specialized elements: very common way to handle tables and equations
- FOSI: a standard way of specifying formatting semantics
- Architectural Forms: assignment of the elements in a specific DTD to a general class with known semantics
Definition of Architectural Forms
An Architectural Form is a name given to a class of elements that are to be processed uniformly by some application. Architectural Forms define base classes. The specific SGML element defined in a specific DTD is then treated as a subclass.
Architectural forms are actually implemented via standard SGML attributes that are added to the DTD. In most cases, these are defined using the #FIXED keyword, setting a specific attribute value for all instances of the element in all documents.
A Simple Example of an Architectural Form
An application may need to know about "title objects" within the documents. Of course, in any specific DTD, the choices of a Generic Identifier for a title object are limitless. It could be called head, h1, title, ti, and so on. To allow the application to identify these title objects, we'll use a specialized attribute called APPTYPE. So, for example, if our specific element is named head:
<!ELEMENT HEAD - - (#PCDATA) >
<!ATTLIST HEAD
APPTYPE NAME #FIXED "TITLE">
As the application is processing a document, every instance of the element HEAD will have associated with it an attribute named APPTYPE with the value TITLE. The application can recognize this and process the element as it would any title.
OLIAS Architectural Forms
- OLIAS.Section - The OLIAS Browser displays the document a section at a time. A section can correspond to any level within the document hierarchy. The OLIAS.Section architectural form identifies those container elements that are to be treated as sections.
- OLIAS.Title - Each section must have a title. This is used in the table of contents view, the window titles, search results, and so on. The value specifies how to construct the title content from element content, attribute values, and literals.
- OLIAS.Shorttitle - Some DTDs provide an element for an abbreviated form of the title content.
- OLIAS.Ignore - Some document content should not be built into the on-line form. This identifies the elements to ignore.
- OLIAS.Graphic - Graphical objects are identified and loaded into the OLIAS information library. The value specifies the entity reference or name of the file containing the graphic data.
- OLIAS.ID - Each section must have a unique identifier. This can be either an attribute value or some element content.
- OLIAS.IDREF - A reference to an element with an OLIAS.ID. This is used to create hypertext links.
- OLIAS.Scope - Assigns an element to a search scope component (such as title or example) that is used to restrict full-text queries.
Functional Language
For architectural forms that take data values, a simple functional language provides a mechanism to assemble combinations of element content, attribute values, and literals.
- ATTR( ) - Uses the attribute value as the content of the architectural form.
- CONCAT( ) - Concatenates the values of subelements and attributes
- FIRSTOF( ) - Choose the first non-empty value
- #CONTENT - Use the element's content as the value
DocBook Example
<!ENTITY % commonatts
'Id ID #IMPLIED
%OLIAS.ID; "attr( Id )"'>
<!ELEMENT Sect1 - - (Title, TitleAbbrev?, (RefEntry+ | Sect2+)) >
<!ATTLIST Sect1
%commonatts;
%OLIAS.Section; >
<!ELEMENT Title - - ((%inlinechar.gp;)+) >
<!ATTLIST Title
%commonatts;
%OLIAS.Title; "#CONTENT" >
<!ELEMENT Graphic - - CDATA>
<!ATTLIST Graphic
Entityref ENTITY #IMPLIED
Fileref CDATA #IMPLIED
Id ID #IMPLIED
%OLIAS.Graphic; "firstof(attr(Entityref),attr(Fileref))"
%OLIAS.ID; "attr( Id )" >
<!ELEMENT Link - - ((%inlinechar.gp;)+) >
<!ATTLIST Link
Linkend IDREF #REQUIRED
%OLIAS.IDREF; "attr( Linkend )" >
<!ELEMENT RefEntry - - (DocInfo?, RefMeta?, RefSect1+) >
<!ATTLIST RefEntry
%commonatts;
%OLIAS.Section;
%OLIAS.Title "firstof(RefMeta,'Reference Section')" >
<!ELEMENT RefMeta - - (RefEntryTitle, ManVolNum? ) >
<!ATTLIST RefMeta
%commonatts;
%OLIAS.Value; "concat( RefEntryTitle, ManVolNum )" >
OLIAS Home Page