THL Toolbox > Developers' Zone > THL Database Technologies and Models > Our Guide to TEI XML Markup > Text Markup - Images
Contributor(s): Nathaniel Garson & David Germano
The general element for various graphics and images to be displayed in an XML document is the same as for links, the <xref> tag. This is used for static images (.jpg, .gif, etc.) and animated ones (movies, panoramas, etc.). The “type” attribute is used to distinguish images from links and types of images from one another. The “n” attribute contains the URL of the image data file in either case.
Pictures, or static images, are represented in an XML document using the <xref> element, as described above. All images can be inserted either within the text of the essay itself by placing the <xref> element at the end of a <p>, or paragraph, element. Or, they can be presented on their own line between paragraphs by included the <xref> inside a paragraph element with no text. In this latter case, the paragraph element should have its “rend” attribute set to “img”, e.g. <p rend= “img”>. The images included within such a <p> tag will be placed in a table with a single row. Thus, the editor should be cautious about including too many images in a single row, generally only 1 or 2 for larger images and 3 or 4 for smaller ones. The “type” attribute of the <xref> should be set to “img” and the “n” attribute should contain the URL for that image. The URL should be a relative URL, relative to the root directory of Tibet, presently on Iris. The caption of the picture should go between the opening and closing <xref> tags. Thus, an example of a picture tag would be:
<xref n="/images/cultgeo/sera/sp026.jpg" type="img">
A view of Sera from the mountain north of the monastery.
To include an interactive panorama, where the mouse can be used to change the view or move the object in the picture, the <xref> tag is also used. However, it must be included within a paragraph element with its “rend” attribute set to “mov”. As with pictures, the caption for the movie in included between the opening and closing <xref> tags. As such images take specific parameters, these parameters are also included within the <xref> tag using <rs> elements (for “reference string”). These are usually placed at the beginning and have their “type” attribute set to the parameter name and the “n” attribute set to the value. Furthermore, these <rs> elements should have their “rend” attribute set to “none”. (Any element with its “rend” attribute set to “none” is not displayed in the resultant HTML document.) An example of a panorama’s markup is:
<p rend = "mov">
<xref n="/images/cultgeo/SeraRear.mov" type="mov">
<rs type="width" n="460" rend="none"></rs>
<rs type="height" n="320" rend="none"></rs>
<rs type="controller" n="true" rend="none"></rs>
Sera Monastery from the rear.