At various points in these Guidelines, the discussion has mentioned the problems which arise when using SGML to encode textual features which do not take a strictly hierarchical form: features, that is, which do not necessarily nest within other features. This chapter provides an overview of the techniques defined in these Guidelines for handling such problems, and should be consulted when deciding how to deal with them.
The following examples illustrate the type of problem with which this
chapter is concerned:
Many other examples might be given, but these should suffice to show the
variety of applications where non-hierarchical or non-nesting
information appears, and to illustrate the various methods for
addressing the problem.
Non-nesting information poses fundamental problems for any encoding scheme, and it must be stated at the outset that no solution has yet been suggested which combines all the desirable attributes of formal simplicity, capacity to represent all occurring or imaginable kinds of structures, suitability for formal or mechanical validation, and clear identity with the notations needed for simpler cases (i.e. cases where the textual features do nest properly). The representation of non-hierarchical information is thus necessarily a matter of choices among alternatives, of tradeoffs between various sets of different advantages and disadvantages.
There are several methods used within these Guidelines to handle
non-nesting information in SGML:
In the sections which follow, these techniques, their advantages, and
their disadvantages, are briefly described, and instances of their use
within these Guidelines are pointed out. The examples show various
solutions to the problem of direct speech spanning several paragraphs in
a narrative; the text in question takes the following form:
The first thing that
put us out was that advertisement. Spaulding, he came
down into the office just this day eight weeks with
this very paper in his hand, and he
says:—
I wish to the Lord, Mr. Wilson, that I was a red-headed
man.
Why that?
I asks.
CONCUR allows us to mark up the document with many different hierarchical structures, but not to reorder the tree or to have different content in different views. Note that the restriction against having different content in different views is imposed not by SGML but by the TEI Interchange Format.
For example, if quotations are marked as part of a distinct markup
stream given the name <(QD)q who=Wilson>Why
that?(QD)q> I asks.(TEI.2)p>
... (QD)q>
]]>
QD
, the outermost speech in our
example need not be broken up into multiple elements:
This method has the advantages of cleanly distinguishing among separate logical hierarchies in the text, using the same structures as non-concurrent markup and thus requiring no special conventions for use (as the other methods described in this chapter do). It has the disadvantage of using a cumbersome notation, which means it could most conveniently be used within an SGML-aware editing environment which masks the complexity of the notation from the user; unfortunately, CONCUR is an optional feature of SGML and is not supported by all SGML processors.
The major use of concurrent markup in the current version of these Guidelines is in the tag set for concurrent markup for pages, columns, and lines defined elsewhere in this chapter.
Milestones use empty elements to mark the beginnings and endings of
regions of the text which have something in common; they work like COCOA
tags. Examples in these Guidelines include the
For example, if quotations are marked using (user-defined) empty
elements given the names The first thing that put us out was that
advertisement. Spaulding, he came down into the
office just this day eight weeks with this very paper
in his hand, and he says:— QB
and QE
, then no element
contains the speeches and they need not be broken up into multiple
elements at the paragraph breaks:
This has the drawback that it is difficult to tell which
The first thing that put us out was that
advertisement. Spaulding, he came down into the
office just this day eight weeks with this very paper
in his hand, and he says:—
This method has the advantage of simplicity; it provides all the information needed to reconstruct all the competing hierarchical views of the text. Many times, the only processing required for an element occurs at its start and end (or can easily be formulated to do so); this markup method handles those cases well. In other cases, however, this method incurs the disadvantage of cumbersome processing: since the elements of the analysis (e.g. the direct speech of Wilson) are not uniformly represented by nodes in the document tree, they must be reconstituted by software in an ad hoc fashion, which may be difficult and is likely to be error prone. Processing elements may often involve more than specified actions at the start and end of an element. Most important for some encoders, this method disguises the logical relationship between the beginning and the ending of each logical element, making it impossible for SGML parsers to provide the same kind of validation possible elsewhere in the encoding.
Fragmentation breaks up what might be considered a single element
into multiple smaller elements, in order to make it fit within the
hierarchy. If a passage of direct discourse begins in the middle of one
paragraph and continues for several more paragraphs, for example, one
could encode the passage as a series of he said
, that the
number of
To tag our example with this method, the outermost speech (Wilson's)
can be broken up to fit into the series of paragraphs, using the
The first thing that
put us out was that advertisement. Spaulding, he came
down into the office just this day eight weeks with
this very paper in his hand, and he
says:—
I
wish to the Lord, Mr. Wilson, that I was a red-headed
man.
Why
that?
I asks.
Among the places where these Guidelines recommend fragmentation as a solution to the encoding of non-nesting information are the discussion of fragmentary verse lines, fragmentary stanzas, and fragmentary embedded texts in drama.
The advantages of this method are that it is simple, that at least one of the competing hierarchies can be processed normally, and that it makes the reconstitution of virtual units much easier, using the method described in the next section. Its disadvantages are that some units are not realized at all in the markup (here, the single long outermost speech of Wilson), and that automatic processing of these units is thus impossible when this method is used without further refinement.
Virtual joins may be used to indicate objects in the text which
would, for whatever reason, be difficult to mark using normal SGML
syntax. In the TEI encoding scheme, virtual joins are most often
expressed by the
The tagging of our example with this method is almost identical to
that given in the preceding section, with the addition of The first thing that
put us out was that advertisement. Spaulding, he came
down into the office just this day eight weeks with
this very paper in his hand, and he
says:—
I
wish to the Lord, Mr. Wilson, that I was a red-headed
man.
Why
that?
I asks.
Alternatively, the The first thing that
put us out was that advertisement. Spaulding, he came
down into the office just this day eight weeks with
this very paper in his hand, and he
says:—
I
wish to the Lord, Mr. Wilson, that I was a red-headed
man.
Why
that?
I asks.
The major advantage of this method is that it allows all the hierarchies in the text to be handled explicitly, both the privileged one directly represented in the SGML and the alternate hierarchy which has been split up and rejoined. Its major disadvantages are that (like most of the other methods described here) it privileges one hierarchy over the others, and requires special processing to reconstitute the elements of the other hierarchies.
Instances of this markup method in these Guidelines include
the
In some cases, the simplest method of disentangling two conflicting hierarchical views of the same information is to encode it twice, each time capturing a single view. Thus, for example, a dictionary headword which gives in a single place the orthography, stress pattern, syllabification, and hyphenation for a word might be encoded several times: once with all the information in a single notation (as in the print dictionary), and once again for each separate piece of information --- or at least, once more for the orthography, to speed up the common operation of searching for the article for a given headword in the electronic dictionary.
The out-of-line treatment of annotation in the feature structure
notation (defined in chapter
The advantages of this method of markup are that each way of looking at the information is explicitly represented in the data, and may be processed in straightforward ways, without requiring complex methods of disentangling information relevant to one view from information relevant only to other views. It has the disadvantage of requiring more space and of introducing redundant information into the encoding, with the resulting risk that one view may be updated without corresponding changes being made to the others, resulting in inconsistencies within the document. Excessive use of redundancy may also make it difficult to reconstruct the exact form of the original source text.
Where the main purpose for encoding alternative hierarchies in a text is to represent competing referencing schemes describing the same basic text, the CONCUR mechanism of SGML provides a very natural solution.
One common form of traditional reference system specifies the page
and line, or page, column, and line of a passage as it appears in some
standard edition. Such references may be specified using a concurrent
markup hierarchy which divides the body of a text into pages and lines
or into pages, columns, and lines. Volumes may also need to be
identified. The document type name should be a short identifier for the
edition cited. The following tags may be used:
Page and line numbers for an edition by Lachmann, for example, might
be specified thus:
The markup shown above would be interleaved with the normal markup
for the document. Since SGML requires tags in concurrent markup streams
to be labeled with their document type, however, the
TEI.2 inserted before each tag's generic identifier. The
combined markup might look something like this:
This concurrent hierarchy is enabled as shown below: after the
document type declaration for the TEI.2 document type, the document
should contain the sequence of lines:
La
. If page and line numbers from more than one standard
edition are to be marked, then the relevant lines may be repeated, each
time using a different value for the document type and entity definition
(where the example has La
). For example, to show page and line
numbers from the editions of Lachmann (La), Kraus (Kr), and
Moser/Tervooren (MT) at the same time, one might use declarations like
the following:
To document a referencing system of this kind
the TEI header, a formal declaration should be provided
in the
Hierarchies similar to that defined above can be provided for most
common hierarchical reference systems. Hierarchies such as act / scene
/ line, for conventional dramatic structure, book / canto / stanza /
line, for longer verse texts, or book / poem / stanza / line, for
collections of verse, may be readily expressed with concurrent SGML
markup. Since these hierarchical structures can readily be represented
using the base tag sets described in part III of these Guidelines,
however, reference systems with such structures may most readily be
expressed using the
Any text with an idiosyncratic standard reference system will
require its own dtd, so that appropriately named tags can be created
for the reference units. Such dtds may follow the pattern of those
described in the preceding section; they should also be documented in
an auxiliary tag set description file, using the tags described in
chapter