About SGMLISUG PubsBookstoreChaptersDeveloping SGMLJoin ISUG

Reusability in SGML with Focus on Software Engineering: Introduction to SGML Architectures

In its simplest form, an architectural form is an element type declaration, with or without an attribute list. This declaration has a well-known semantic. The SGML architecture concept relies on a general name mapping mechanism, which allows element type declarations from existing DTDs to be related to the declarations in the architecture.

Let us explain this mechanism with a simple example from HyTime. Here is the clink architectural form:

<!-- Contextual Link -->
<!element clink    -- Contextual link --
                   - O      (%HyBrid;)* >
<!attlist clink    HyTime   NAME     clink
                   id       ID       #IMPLIED  -- Default: none --
                   linkend  -- Link end --
                            -- Constraint: No HyTime reftype constraints,
                               but application designers can constrain
                               element types with reftype attribute --
                            IDREF    #REQUIRED
>

This is a normal element type declaration with an attlist and some comments describing constraints and semantics.

Now suppose you have already a DTD named mydtd, with some kind of local cross-referencing mechanism, in the form of an element named myref with a target attribute indicating the referenced element:

<!DOCTYPE mydtd [
<!-- ... -->
<!ELEMENT myref - O (#PCDATA)>
<!ATTLIST myref 
          id      ID    #IMPLIED
          target  IDREF #REQUIRED
>
]>

To make it work as a HyTime clink, you must slightly modify your DTD, to establish the name mapping between your DTD and the HyTime architecture:

<!DOCTYPE mydtd [
<!-- ... -->
<!ELEMENT myref - O (#PCDATA)>
<!ATTLIST myref 
          id      ID    #IMPLIED
          target  IDREF #REQUIRED
          -- HyTime AFO mapping --
          HyTime  NAME  #FIXED clink
          HyNames NAMES #FIXED "linkend target"
>
]>

The HyTime attribute specifies the mapping for the generic identifier. In this case, it means the myref element is to be treated as a clink HyTime element. The HyNames attribute specifies the name mapping between the attributes in the source DTD and the HyTime specification. In this case, it means the target attribute in mydtd is playing the role of the linkend HyTime attribute.

Alternatively, you can avoid modifying your DTD by adding a Link Process Definition (LPD), which is a somewhat cleaner process whereby you avoid cluttering your DTD with AFO references:

<!LINKTYPE mylink mydtd #IMPLIED [
<!ATTLIST myref
          HyTime  NAME  #FIXED clink
          HyNames NAMES #FIXED "linkend target"
>
<!LINK #INITIAL
myref
>
]>

This IMPLICIT link declaration defines two fixed LINK attributes. If the mylink LINKTYPE is activated, the application will have access to the two link attributes HyTime and HyNames playing the same role as if they had been declared in the DTD.

[Next Section]   [Previous Section]

Contact Robin Cover with corrections and updates, or to submit contributions to the ISUG online document database.

ISUG
logo
Copyright © 1997 International SGML Users' Group