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

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

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.


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