Implemented thumbnails for text documents
For text documents which have a thumbnail, the thumbnail is linked by including it in a <note> tag in the <biblStruct> in the <teiHeader>:
<biblStruct> [...] <note><graphic url="thumb_varin.jpg"/></note> </biblStruct>
The XQuery finds this because it's looking for the first <graphic> element in the document. The XSLT is able to distinguish between <graphic>s in image markup files (which have no preceding "thumb_" in the filename) and these items, which do; the "thumb_" is only supplied in the teaser where it's needed. In the case of image markup files, the <graphic> the <facsimile> part of the document links to the main image for the file, and the thumbnail link is constructed from it, on the assumption (always true) that it exists; in the case of text documents, the thumbnail is the only image, so its filename is complete, but the XSLT is sensitive to this.