Text Markup - Links

THL Toolbox > Developers' Zone > THL Database Technologies and Models > Our Guide to TEI XML Markup > Text Markup - Links

Text Markup - Links

Contributor(s): Nathaniel Garson & David Germano

There are two types of linking elements. A pointer element, <ptr /> and <xptr />, is merely that. It contains no textual content but is an empty element. All the data concerning the link is contained in its attributes. A reference element, <ref> and <xref>, is an element that creates a link around some text and works in the same manner as an <a> element with an href attribute. There are two kinds of links: internal links that point to an anchor or ID elsewhere in the same document and external links that point to another separate document or file.

Internal Links

Internal links point to another section of the same document. The link is created by setting the “target” attribute of the linking element to the same value as the ID attribute of the target element. Thus, if one wanted to point to the beginning of section three, which was marked with the opening tag, <div type=“section” n=“3” id=“s3”> … Then, the pointer would look like this: <ptr target=“s3” /> and the reference tag would be: <ref target=“s3”>Go to section 3</ref>. If there is no opening element at the specific point one wants to link to, the <anchor/> element may be used. This is an empty element that can be assigned an ID for the purposes of linking. It can be inserted virtually anywhere.

External Links

External links point to another separate document. In this instance, we do not use the “target” attribute as with internal links. external link: footnote3 Instead, the type attribute is used to indicate the general type of target. The targType attribute is used to indicate the specific type of target, and the n attribute contains the file name. The values for these attributes can be:

* type: text, xml, url, image, audio, video, plaintext * targType: {name of DTD}, gif, jpg, mpg, flash, txt, etc. * note: this feature is not functional at present, so do not use the targType attribute. * n: e.g. Tb.343.bib.xml, image2.gif, intro.mpg, … * note: in the type attribute, "text" refers to an XML text, whereas plaintext refers to plain text. When a THL XML document is referred to, then the n attribute value must begin with the collection and not with the root directory, which is /tibet/. In the future, we hope to use the targType attribute to refer to non-THL XML documents, in which case its value will be the name of the DTD.

Footnotes

3. Strictly speaking, one should include at the top of an XML document an entity reference to each external document it links to, but because of practical considerations, we are not doing it that way.

This page is provided courtesy of the external link: Tibetan and Himalayan Library.