The internal structure of div

div type subdivision

The internal structure of the TEI div element is fairly simple. It falls into three segments: the top, middle, and bottom.

A div may start with one or more elements from the divtop class (which includes elements like opener, head, and other elements that typically fall at the beginning of textual divisions such as argument, dateline, salute). These elements are optional, but if they appear it must be at the beginning of the div.

Following these starting elements, the main body of the div may consist either of a series of paragraphs and other chunk-level elements such as lists, quotations, notes, tables, and figures, or a series of div elements. Compare examples 1 and 2.

At the end of the div, you may have one or more elements from the divbot class, which denotes the elements that typically fall at the end of textual divisions. These include closer, trailer, salute, signed, and dateline. As with the elements in the divtop class, these are all optional, but their appearance signals the end of the div. Once you have had one of these, you can only have additional divbot elements, not elements intended for the middle of the div.

More than you wanted to know...

Note that many of the divbot elements also are members of the divtop class. This is because many of these features (for instance, salutations) may appear at the beginning or ending of a text or subdivision. The logic here may seem confusing: if having a divtop element means the division is over, what if you have a salutation at the beginning of the division? How does the validator know that it’s serving as a divtop element and not a divbot element? The answer is that the content model which governs the structure of div contains sequencing information which identifies each segment of the division—its top, middle and bottom—and indicates their required order. As the validator reads through the document, it knows (based on this information) that when it sees an element from the class that is permitted in the middle of the division, the top of the division must be over and done with. Hence any further elements it sees—for instance, a concluding salutation—can only be operating in their capacity as divbot elements.


Example 1: A simple div with paragraphs and other chunk-level items

  <head>An Essay on Absurdity</head>
    <quote>Absurdity, absurdity, all is absurdity.</quote>
  <p>Of absurdity, the poet tells us, in very bad Latin, there is no
  end and no beginning...</p>
  <quote>De absurditate nihil mihi finis incipitque.</quote>
  <p>And yet, in the flower of the field (see figure 1), there is no
    <p>Chrysanthemum leucanthemum</p>
    <figDesc>A woodcut of a daisy</figDesc>
    <head>Absurdities anatomized</head>
    <item>Swift absurdities</item>
    <item>Slow absurdities</item>
    <item>Absurdities that strike the brain forcibly</item>
    <item>Absurdities that leave no trace</item>
  <p>I have done; no more on absurdities.</p>

Example 2: a div consisting mostly of other divs.

<div type="essay">
  <head>An Essay on Nonsense</head>
  <p>Of nonsense, we can at least say that it allows of anatomization.</p>
  <div type="section">
    <head>Of Simple Nonsense</head>
    <p>Simple nonsense is by far the finest and purest kind...</p>
  <div type="section">
    <head>Of Complicated Nonsense</head> 
    <p>Nothing is more complicated than complicated nonsense, and yet
    it yields so little to the imagination...</p>