Skip to content

Commit fe0a822

Browse files
author
Irene Vagionakis
committed
minor changes to the sample xslt template structure (dimensions, origin, bibliography)
1 parent 500333b commit fe0a822

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

htm-tpl-struct-sample.xsl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@
118118
<xsl:text>)</xsl:text>
119119
</xsl:if>
120120
</xsl:when>
121+
<xsl:when test="//t:origin/t:date//text()">
122+
<xsl:apply-templates select="//t:origin/t:date"/>
123+
<xsl:if test="//t:origin/t:date[@evidence]">
124+
<xsl:text> (</xsl:text>
125+
<xsl:for-each select="tokenize(//t:origin/t:date/@evidence,' ')">
126+
<xsl:value-of select="translate(translate(.,'-',' '),',','')"/>
127+
<xsl:if test="position()!=last()">
128+
<xsl:text>, </xsl:text>
129+
</xsl:if>
130+
</xsl:for-each>
131+
<xsl:text>)</xsl:text>
132+
</xsl:if>
133+
</xsl:when>
121134
<xsl:otherwise>Unknown.</xsl:otherwise>
122135
</xsl:choose>
123136
</p>
@@ -136,6 +149,9 @@
136149
<xsl:when test="//t:origin/t:origPlace//text()">
137150
<xsl:apply-templates select="//t:origin/t:origPlace"/>
138151
</xsl:when>
152+
<xsl:when test="//t:origin/t:placeName//text()">
153+
<xsl:apply-templates select="//t:origin/t:placeName"/>
154+
</xsl:when>
139155
<xsl:otherwise>Unknown</xsl:otherwise>
140156
</xsl:choose>
141157
</p>
@@ -357,14 +373,20 @@
357373
</div>
358374
</xsl:if>
359375

360-
<xsl:if test="//t:div[@type='bibliography']//text()">
376+
<xsl:if test="//t:div[@type='bibliography']//text() or //t:teiHeader//t:listBibl//text()">
361377
<div id="bibliography">
362378
<xsl:for-each select="//t:div[@type='bibliography']">
363379
<h3>Bibliography
364380
<xsl:if test="@subtype"><xsl:text> (</xsl:text><xsl:value-of select="@subtype"/><xsl:text>)</xsl:text></xsl:if></h3>
365381
<xsl:apply-templates select="descendant::t:p"/>
366382
<xsl:apply-templates select="descendant::t:listBibl"/>
367383
</xsl:for-each>
384+
385+
<xsl:for-each select="//t:teiHeader//t:listBibl">
386+
<h3>Bibliography
387+
<xsl:if test="@type"><xsl:text> (</xsl:text><xsl:value-of select="@type"/><xsl:text>)</xsl:text></xsl:if></h3>
388+
<p><xsl:apply-templates select="descendant::t:bibl"/></p>
389+
</xsl:for-each>
368390

369391
<xsl:if test="//t:creation//text()">
370392
<p><b>Text constituted from: </b>
@@ -415,6 +437,7 @@
415437

416438
<!-- dimensions -->
417439
<xsl:template match="t:dimensions" mode="sample-dimensions">
440+
<xsl:if test="@type"><xsl:value-of select="@type"/><xsl:text>: </xsl:text></xsl:if>
418441
<xsl:if test="//text()">
419442
<xsl:if test="t:width/text()"><xsl:text>w </xsl:text>
420443
<xsl:value-of select="t:width"/>
@@ -436,6 +459,7 @@
436459
<xsl:if test="t:dim[@type='diameter'][@unit]"><xsl:text> </xsl:text><xsl:value-of select="t:dim[@type='diameter']/@unit"/></xsl:if>
437460
</xsl:if>
438461
<xsl:if test="@unit"><xsl:text> </xsl:text><xsl:value-of select="@unit"/></xsl:if>
462+
<xsl:text> </xsl:text>
439463
</xsl:if>
440464
</xsl:template>
441465

0 commit comments

Comments
 (0)