Skip to content

Commit b003e97

Browse files
committed
fixed bugs with (a) missing parameter calls; (b) clashing facsimile templates
1 parent 15d2f4c commit b003e97

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

htm-teifacsimile.xsl

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,49 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!-- $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">
3+
<xsl:stylesheet exclude-result-prefixes="t" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+
xmlns:t="http://www.tei-c.org/ns/1.0" version="2.0">
75

86
<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>
7+
<xsl:param name="parm-edn-structure" tunnel="yes" required="no"/>
8+
<xsl:choose>
9+
<xsl:when test="$parm-edn-structure = 'medcyprus'"/>
10+
<xsl:otherwise>
11+
<!-- Being concerned only with the images, ignore everything else. -->
12+
<div id="facsimile-images">
13+
<h2>Facsimile Images</h2>
14+
<xsl:apply-templates select=".//t:graphic"/>
15+
</div>
16+
</xsl:otherwise>
17+
</xsl:choose>
1518
</xsl:template>
1619

1720
<!-- Display a local image with thumbnail. -->
1821
<xsl:template match="t:graphic">
19-
<xsl:param name="parm-image-loc" select="''" tunnel="yes" />
22+
<xsl:param name="parm-image-loc" select="''" tunnel="yes"/>
2023
<!-- Create a link to the full image and display a thumbnail
2124
image.
2225
2326
The thumbnail image URL is constructed from the original URL
2427
via prefixing the final "." with "-thumb". This may lead to
2528
ugly URLs if the original URL does not include an extension
2629
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" />
30+
<xsl:variable name="url-parts" select="tokenize(@url, '\.')"/>
31+
<xsl:variable name="count-url-parts" select="count($url-parts) - 1"/>
2932
<a href="{concat($parm-image-loc, @url)}">
3033
<img title="{t:desc}">
3134
<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), '.')" />
35+
<xsl:value-of select="$parm-image-loc"/>
36+
<xsl:value-of select="string-join(subsequence($url-parts, 1, $count-url-parts), '.')"/>
3437
<xsl:text>-thumb.</xsl:text>
35-
<xsl:value-of select="subsequence($url-parts, $count-url-parts)[last()]" />
38+
<xsl:value-of select="subsequence($url-parts, $count-url-parts)[last()]"/>
3639
</xsl:attribute>
3740
</img>
3841
</a>
3942
</xsl:template>
4043

4144
<!-- Display an image. -->
4245
<xsl:template match="t:graphic[contains(@url, '://')]">
43-
<img src="{@url}" title="{t:desc}" />
46+
<img src="{@url}" title="{t:desc}"/>
4447
</xsl:template>
4548

4649
</xsl:stylesheet>

htm-teig.xsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<xsl:param name="location" tunnel="yes" required="no"></xsl:param>
1515
<xsl:call-template name="lb-dash">
1616
<!-- params needed for excluding diplomatic and medCY project -->
17-
<xsl:with-param name="parm-edition-type"/>
18-
<xsl:with-param name="parm-leiden-style"/>
17+
<xsl:with-param name="parm-edition-type" tunnel="yes"/>
18+
<xsl:with-param name="parm-leiden-style" tunnel="yes"/>
1919
</xsl:call-template>
2020
<xsl:call-template name="w-space"/>
2121

teiheader.xsl

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
<xsl:template match="t:teiHeader"/>
88

9-
<xsl:template match="t:facsimile">
9+
<!-- The template below clashed with and so has been merged with one in htm-teifacsimile.xsl 2024-03-20 -->
10+
<!--<xsl:template match="t:facsimile">
1011
<xsl:param name="parm-edn-structure" tunnel="yes" required="no"/>
1112
<xsl:choose>
1213
<xsl:when test="$parm-edn-structure='medcyprus'"/>
1314
<xsl:otherwise>
1415
<xsl:apply-templates/>
1516
</xsl:otherwise>
1617
</xsl:choose>
17-
</xsl:template>
18+
</xsl:template>-->
1819

1920
</xsl:stylesheet>

0 commit comments

Comments
 (0)