Previous Table of Contents Next


Footnotes and Endnotes

In SGML, footnotes and endnotes can be treated as if they are the same. What you, as an SGML author, want to provide the readers with is some supplementary information—like a reference or citation, for example—without interrupting their flow of thought. This is not a formidable task in SGML. To avoid a parsing challenge, you need to look out for recursion in your DTD.


Note:  
Recursion is nesting elements inside each other in a type of loop. For example, suppose that your DTD states that A can contain B, B contains C, and C contains A. Therefore, C can contain A, B, or C.

In the case of footnotes, this can be a little dangerous. Consider if <SECTION> contains <PARA>, which contains <FOOTNOTE>, which contains <PARA>. This is an example of recursion because this makes it possible to have a footnote within a footnote. This is probably not what you want in your document design.


With this type of structure in place, you will not get a parsing error when you should. You could actually have a footnote within a footnote within a footnote and not receive an error.

The most common way around this footnote challenge is to use inclusion at a high structural level and exclusion at a low structural level in the document. Here’s an example of how it might appear in a DTD:

     <!ELEMENT section     - -   (para+)        +(footnote)  >
     <!ELEMENT para        - -   (#PCDATA)                   >
     <!ELEMENT footnote    - -   (para+)        -(footnote)  >

This type of structure gives you the flexibility to put a footnote anywhere within a section, yet does not permit a footnote to occur within a footnote. It still allows paragraphs within footnotes, however. Just make sure that footnotes are included at a high enough level for you to use them as freely as you need to.

Citations and Bibliographies

The discussion of footnotes naturally leads into a related discussion about citations. How do you cite a work whose content is referenced in your writing? Much like a hard copy, you can put the citation in a footnote or endnote. However, because footnotes and endnotes are identical in SGML (the processing system determines where the notes are placed), they’re much simpler to handle than on hard copy.

Suppose you’re writing about a subject and want to make a citation to your source. Your markup might look like this:

     We find that the latest research on the subject indicates no
     incidence of side-effects on patients receiving 50mg per day
     of the drug whose medical records showed no history of
     allergy. <cite>Hudson, B.W., <emph>Study for
     Incidence of Side Effects with x-drug</emph>, BigCity
     [1996], Big City Press; pp. 129&endash;175.</cite>
     The remaining research just goes on and on about…

The nice thing about citation tags like this is that your processing system can use your <CITATION> tags to build a bibliography. This sort of structure lends itself to macro-oriented formatting by a processing system. Some formatter can extract all of the citations and alphabetically sort them, strip page numbers, and build a bibliography. That can be very useful.

Many times, you want to not only cite a source but make a reference to an endnote. This can be accomplished through markup similar to the following:

     We find that the latest research on the subject indicates no
     incidence of side-effects on patients receiving 50mg per day
     of the drug whose medical records showed no history of
     allergy. <citref refid=“Hudson1”>The remaining
     research just goes on and on about…

The citation collection could exist in a separate document or later in the same document:

     <citation id=“Hudson1”>Hudson, B.W.,      <emph>Study for
     Incidence of Side
     Effects with x-drug</emph>, BigCity [1996],
     Big City Press; pp. 129&endash;175.</citation>

This is one effective way to handle citations. As you’re authoring your document, you can place the <CITATION> information inline with the <CITREF> information. This leaves it to the text formatter to determine where to physically place the citations.

Multimedia Linking


• See “Adding a Graphic,” p. 162

SGML offers many ways to link electronic documents to binary resources like video clips, graphics, and other multimedia resources. Making an EMPTY element point to an external resource with its attributes is only one possibility, as you saw in Chapter 9. There are others. For example, you can give names to multimedia files and declare them as entities, and then declare the name of the entity as a value for an attribute of the EMPTY element in your DTD:

     <!ELEMENT multimed  - -        (multfil, title)            >
     <!ELEMENT title     - o        (#PCDATA)                   >
     <!ELEMENT multfil   - o        EMPTY                       >
     <!ATTLIST multfil   - o        id        ID       #REQUIRED>
                                    name      ENTITY   #REQUIRED>

Notice that the name attribute is required to be an entity. The declaration for that entity could lead the processing system to the file itself. Here’s the declaration:

     <!ENTITY mymovie  SDATA  “/usr/movies/home/mymovie.mov”    >

The markup is what unifies the name attribute with the entity itself in the following document instance excerpt:

     My family and I are extremely happy, and you can see that in
     <multimed><multfil id=“0001” name=“mymovie”> this home
     movie</multfil></multimed>, and if you want a copy, just…

Now when the processing system sees that name=“mymovie”, it knows it is an entity because that is all the DTD allows it to be. The system will resolve the path to the file and link to it. In keeping with SGML’s independence from specific hardware and software, this link processing is kept separate from the instance of the marked up file.


Previous Table of Contents Next