Text Encoding Initiative |
|
12. Lists |
The element <list> is used to mark any kind of list. A list is a sequence of text items, which may be ordered, unordered, or a glossary list. Each item may be preceded by an item label (in a glossary list, this label is the term being defined):
Individual list items are tagged with <item>. The first <item> may optionally be preceded by a <head>, which gives a heading for the list. The numbering of a list may be omitted (if reconstructible), indicated using the n attribute on each item, or (rarely) tagged as content using the <label> element. The following are all thus equivalent:
<list> <head>A short list</head> <item>First item in list.</item> <item>Second item in list.</item> <item>Third item in list.</item> </list> <list> <head>A short list</head> <item n="1">First item in list.</item> <item n="2">Second item in list.</item> <item n="3">Third item in list.</item> </list> <list> <head>A short list</head> <label>1</label><item>First item in list.</item> <label>2</label><item>Second item in list.</item> <label>3</label><item>Third item in list.</item> </list>The styles should not be mixed in the same list.
A simple two-column table may be treated as a glossary list, tagged <list type="gloss">. Here, each item comprises a term and a gloss, marked with <label> and <item> respectively. These correspond to the elements <term> and <gloss>, which can occur anywhere in prose text.
<list type="gloss"> <head>Vocabulary</head> <label lang="enm">nu</label> <item>now</item> <label lang="enm">lhude</label> <item>loudly</item> <label lang="enm">bloweth</label> <item>blooms</item> <label lang="enm">med</label> <item>meadow</item> <label lang="enm">wude</label> <item>wood</item> <label lang="enm">awe</label> <item>ewe</item> <label lang="enm">lhouth</label> <item>lows</item> <label lang="enm">sterteth</label> <item>bounds, frisks</item> <label lang="enm">verteth</label> <item lang="lat">pedit</item> <label lang="enm">murie</label> <item>merrily</item> <label lang="enm">swik</label> <item>cease</item> <label lang="enm">naver</label> <item>never</item> </list>
Where the internal structure of a list item is more complex, it may be preferable to regard the list as a table, for which special-purpose tagging is defined below (14. Tables).
Lists of whatever kind can, of course, nest within list items to any depth required. Here, for example, a glossary list contains two items, each of which is itself a simple list:
<list type="gloss"><label>EVIL</label> <item><list type="simple"> <item>I am cast upon a horrible desolate island, void of all hope of recovery.</item> <item>I am singled out and separated as it were from all the world to be miserable.</item> <item>I am divided from mankind — a solitaire; one banished from human society.</item> </list> <!-- end of first nested list --></item> <label>GOOD</label> <item><list type="simple"> <item>But I am alive; and not drowned, as all my ship's company were.</item> <item>But I am singled out, too, from all the ship's crew, to be spared from death...</item> <item>But I am not starved, and perishing on a barren place, affording no sustenances....</item> </list><!-- end of second nested list --></item> </list><!-- end of glossary list -->
A list need not necessarily be displayed in list format. For example,
On those remote pages it is written that animals are divided into <list rend="run-on"><item n="a">those that belong to the Emperor,<item n="b"> embalmed ones, <item n="c"> those that are trained, <item n="d"> suckling pigs, <item n="e"> mermaids, <item n="f"> fabulous ones, <item n="g"> stray dogs, <item n="h"> those that are included in this classification, <item n="i"> those that tremble as if they were mad, <item n="j"> innumerable ones, <item n="k"> those drawn with a very fine camel's-hair brush, <item n="l"> others, <item n="m"> those that have just broken a flower vase, <item n="n"> those that resemble flies from a distance.</list>
Lists of bibliographic items should be tagged using the <listBibl> element, described in the next section.
Up: Contents Previous: 11. Names, Dates, Numbers and Abbreviations Next: 13. Bibliographic Citations