Thdl Essays Xml Mark-up: Glossaries

THL Toolbox > Developers' Zone > Web Development > THL Essays in Cocoon > THL Essays XML Mark-up: Glossaries

THL Essays XML Mark-up: Glossaries

Glossaries are found as the first <div1> in the back section of a text. Because glossaries are often shared between several related documents (e.g. Sera Hermitages), they are stored as separate XML files that are included within each essay using that glossary. This is done by an entity declaration for the glossary within the DTD statement, and a reference to that entity in the back section of the text where the glossary is to be inserted. Thus, for Sera Hermitages document the glossary include would look like:

<!DOCTYPE TEI.2 SYSTEM "http://www.thdl.org/global/xml/dtds/xtib3.dtd" [
	<!ENTITY % extlinks SYSTEM "../external-links.dtd" >
	%extlinks;
	
	<!ENTITY glossary SYSTEM "glossaries/cabezon-sera-herm-gloss.xml">
	 
	 … {other entity declarations} …
]>

<TEI.2>
	<teiHeader lang="eng">
	   …
	</teiHeader>
	<text>
	    <front>
	     …
	    </front>
	    <body>
	     …
        </body>
		<back>
			&glossary;
		</back>
	</text>
</TEI.2>

Glossaries are located in a "glossaries" sub-folder along side the XML document. Thus, since all the Sera Hermitage essays were written by Jose Cabezon, they are found in trunk/essays/xml/c/ and their shared glossary is found in trunk/essays/xml/c/glossaries. Should another author, say with the last name Cabot, also write an essay with a glossary for THL. His glossary would go in the same folder.

Glossary file names are prefaced with the author's last name followed by an abbreviated descriptive name and ending with "-gloss.xml". Thus, for Sera hermitages the file name is: cabezon-sera-herm-gloss.xml.

Glossary File Structure

All the glossary entries are found in a single <div1> element with an unique id of "c1" ("c" stands for the back section and "1" stands for the first subsection of the back section) and a type attribute set to "glossary". Glossary entries are arranged in Tibetan alphabetical order with each letter-section prefaced by an <anchor> tag that identifies that section. Sanskrit, Chinese and Mongolian only terms are found in the own sections at the end of the glossary. The anchor element for each subsection of the glossary has a type="tiblet" for Tibetan letter sections or type="language name" for other languages. Tibetan letter sections have an n attirbute set to the wylie for that letter and a rend attribute set to the capitalized version for display purposes.

Each entry within a subsection is found in a <p> element with a unique id="entry###". These paragraph elements have the following children in the following order:

  • num n="tib-sort-order": contains a sequential number used for sorting purposes when sorting is done programatically
  • term lang="tib" n="phonetic of Tibetan": contains the Wylie for the Tibetan term with the phonetic rendering in the n attribute
  • term lang="eng": contains the English translation of the term
  • term lang="san": contains the Sanskrit translation of the term
  • term lang="chi": contains the Chinese translation of the term
  • term lang="mon": contains the Mongolian translation of the term
  • rs type="type" n="term": contains the type designation for the term, e.g. Person, Deity, Term, Date, Place, etc.
  • date value="YYY-MM-DD": contains the date associated with a person
  • rs type="lang": contains the main language of the term, e.g., tib, san, chi. Use the three letter abbreviation here.

Example

An example of the beginning of a glossary file with its first term is found below:

<div1 id="c1" type="glossary">
	<head>Glossary</head>
	<anchor type="tiblet" n="ka" rend="Ka"/>
	<p id="entry337">
		<num n="tib-sort-order">1</num>
		<term lang="tib" n="katung">ka thung</term>
		<term lang="eng">short pillar</term>
		<term lang="san"/>
		<term lang="chi"/>
		<term lang="mon"/>
		<rs type="type" n="term">Term</rs>
		<date value=""/>
		<rs type="lang">tib</rs>
	</p>

  ....
</div1>

Provided for unrestricted use by the external link: Tibetan and Himalayan Library