Text structure

From XML
Revision as of 13:30, 26 April 2017 by PBO (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

While encoding texts, the textual hierarchy is being taken into account. Every single text is encoded using the <text> element, which contains a mandatory <body> element. If so desired, any possible (hierarchical) substructure of the text can be encoded through <div> (‘division’) elements, each enclosing one or more <p> (‘paragraph’) elements and complemented with an @type attribute that describes what kind of division is meant.

The type of elements contained by the <text> depends on the type of text that is being encoded. For example, the text of prose usually consists of one or more <p> elements, whereas poetry consists of <lg> (‘line group’) elements that in itself enclose one or more <l> (‘line’) elements. Titles and such can be encoded with a <head> element.

Example:

<text>
 <body>
  <div type="part">
   <head>Opschrift</head>
   <p>Tekst van onderdeel</p>
   <div type="chapter" n="1">
    <head>Opschrift</head>
    <p>Tekst van hoofdstuk 1</p>
    <div type="section" n="1.1">
     <head>Tussenkop</head>
     <p>Tekst van paragraaf 1.1</p>
    </div>
    <div type="section" n="1.2">
     <head>Tussenkop</head>
     <p>Tekst van paragraaf 1.2</p>
     <p>Tekst van paragraaf 1.2 (vervolg)</p>
     <p>Tekst van paragraaf 1.2 (verder vervolg)</p>
    </div>
   </div>
  </div>
 </body>
</text>

In some editions, the upper level <text> element contains a number of independent texts. In that case, the <group> element is used to as a container for lower-level <text> elements holding the individual texts. Groups can be nested, if desired.

Rather than

elements, we sometimes use <ab> (anonymous block) elements. This is meant to encode any block-level piece of text that is noty necessarily also a paragraph.

See also