Skip to content

Commit 1d25aa2

Browse files
author
Irene Vagionakis
committed
re-added stylesheets for facsimile; edited link
1 parent 1dad81f commit 1d25aa2

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

htm-teifacsimile.xsl

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- $Id$ -->
3+
<xsl:stylesheet exclude-result-prefixes="t"
4+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5+
xmlns:t="http://www.tei-c.org/ns/1.0"
6+
version="2.0">
7+
8+
<xsl:template match="t:facsimile">
9+
<!-- Being concerned only with the images, ignore everything else. -->
10+
<div id="facsimile-images">
11+
<h2>Facsimile Images</h2>
12+
13+
<xsl:apply-templates select=".//t:graphic" />
14+
</div>
15+
</xsl:template>
16+
17+
<!-- Display a local image with thumbnail. -->
18+
<xsl:template match="t:graphic">
19+
<xsl:param name="parm-image-loc" select="''" tunnel="yes" />
20+
<!-- Create a link to the full image and display a thumbnail
21+
image.
22+
23+
The thumbnail image URL is constructed from the original URL
24+
via prefixing the final "." with "-thumb". This may lead to
25+
ugly URLs if the original URL does not include an extension
26+
suffix but does have a "." in it. -->
27+
<xsl:variable name="url-parts" select="tokenize(@url, '\.')" />
28+
<xsl:variable name="count-url-parts" select="count($url-parts)-1" />
29+
<a href="{concat($parm-image-loc, @url)}">
30+
<img title="{t:desc}">
31+
<xsl:attribute name="src">
32+
<xsl:value-of select="$parm-image-loc" />
33+
<xsl:value-of select="string-join(subsequence($url-parts, 1, $count-url-parts), '.')" />
34+
<xsl:text>-thumb.</xsl:text>
35+
<xsl:value-of select="subsequence($url-parts, $count-url-parts)[last()]" />
36+
</xsl:attribute>
37+
</img>
38+
</a>
39+
</xsl:template>
40+
41+
<!-- Display an image. -->
42+
<xsl:template match="t:graphic[contains(@url, '://')]">
43+
<img src="{@url}" title="{t:desc}" />
44+
</xsl:template>
45+
46+
</xsl:stylesheet>

htm-tpl-struct-sample.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
<span>&#160;</span>
406406
<xsl:choose>
407407
<xsl:when test="contains(@url,'http')">
408-
<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>[Open image]</a>
408+
<a target="_blank" href="{@url}">[Open image]</a>
409409
</xsl:when>
410410
<xsl:otherwise>
411411
<xsl:apply-templates select="." />

start-edition.xsl

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<xsl:include href="htm-teidiv.xsl"/>
1616
<xsl:include href="htm-teidivedition.xsl"/>
1717
<xsl:include href="htm-teidivapparatus.xsl"/>
18+
<xsl:include href="htm-teifacsimile.xsl"/>
1819
<xsl:include href="htm-teiforeign.xsl"/>
1920
<xsl:include href="htm-teifigure.xsl"/>
2021
<xsl:include href="htm-teig.xsl"/>

txt-teifacsimile.xsl

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Id$ -->
3+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+
xmlns:t="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="t"
5+
version="2.0">
6+
7+
<xsl:template match="t:facsimile"/>
8+
9+
</xsl:stylesheet>

0 commit comments

Comments
 (0)