Skip to content

Commit

Permalink
Change apparatus to output HTML span elements in apparatus display. A…
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalesky committed Aug 30, 2017
1 parent 4e7ee2f commit ff6f364
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 57 deletions.
3 changes: 3 additions & 0 deletions htm-teiaddanddel.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<xsl:import href="teiaddanddel.xsl"/>

<xsl:template match="t:subst">
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:apply-imports/>
</xsl:template>


<xsl:template match="t:add">
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<xsl:when test="($parm-leiden-style = ('ddbdp','dclp','sammelbuch')) and @place='interlinear'">
Expand All @@ -26,6 +28,7 @@


<xsl:template match="t:del">
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:apply-imports/>
</xsl:template>

Expand Down
24 changes: 15 additions & 9 deletions htm-teiapp.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<!-- Contains app and its children rdg, ptr, note and lem -->

<xsl:template match="t:app">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"/>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="@resp='previous'">
<span class="previouslyread">
Expand All @@ -19,18 +20,23 @@
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>

<!-- Found in htm-tpl-apparatus - creates links to footnote in apparatus -->
<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
</xsl:call-template>
</xsl:if>

<!-- Found in htm-tpl-apparatus - creates links to footnote in apparatus -->
<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<xsl:call-template name="app-link">
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>


<xsl:template match="t:rdg">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-edition-type" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="$parm-edition-type = 'diplomatic'">
<xsl:choose>
Expand Down
3 changes: 2 additions & 1 deletion htm-tpl-apparatus.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
<xsl:text>(*)</xsl:text>
</a>
</xsl:when>
<xsl:when test="$location = 'apparatus'">
<!-- Output at begining of each apparatus entry, suppresses duplicate output at end of apparatus. if $location='apparatus' -->
<xsl:when test="$location = 'apparatus-link-back'">
<a>
<xsl:attribute name="id">
<xsl:text>to-app-</xsl:text>
Expand Down
20 changes: 16 additions & 4 deletions teiaddanddel.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@

<xsl:template match="t:subst">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:apply-templates/>

<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<!-- Found in [htm|txt]-tpl-apparatus -->
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
</xsl:call-template>
<xsl:call-template name="app-link">
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

Expand Down Expand Up @@ -107,11 +113,17 @@
<xsl:template match="t:del">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<xsl:if test="@rend = 'slashes' or @rend = 'cross-strokes'">
<!-- Found in [htm | txt]-tpl-apparatus -->
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:if>
Expand Down
10 changes: 9 additions & 1 deletion teichoice.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<xsl:template match="t:choice">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<!-- This causes an error missing ' for which read ' in apparatus title, need to investigate.
<xsl:param name="location" tunnel="yes" required="no"/>-->
<xsl:choose>
<xsl:when test="child::t:sic and child::t:corr and starts-with($parm-leiden-style, 'edh')">
<xsl:text>&lt;</xsl:text>
Expand All @@ -24,7 +27,12 @@
<xsl:if
test="$parm-apparatus-style = 'ddbdp' and ((child::t:sic and child::t:corr) or (child::t:orig and child::t:reg))">
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
Expand Down
8 changes: 7 additions & 1 deletion teigap.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,19 @@


<xsl:template match="t:gap[@reason='illegible']">
<xsl:param name="location" tunnel="yes" required="no"/>
<!-- certainty -->
<xsl:if test="child::t:certainty[@match='..']">
<xsl:text>?</xsl:text>
</xsl:if>

<xsl:if test="not(preceding::node()[1][self::text()][normalize-space(.)=''][preceding-sibling::node()[1][self::t:gap[@reason='illegible']]])
and not(preceding::node()[1][self::t:gap[@reason='illegible']])">
and not(preceding::node()[1][self::t:gap[@reason='illegible']]) and not($location = 'apparatus')">
<xsl:call-template name="extent-string"/>
</xsl:if>

<!-- Apparatus display-->
<xsl:if test="$location = 'apparatus' and not(preceding::node()[1][self::text()][normalize-space(.)=''][preceding-sibling::node()[1][self::t:gap[@reason='illegible']]]) and not(preceding-sibling::node()[1][self::t:gap[@reason='illegible']])">
<xsl:call-template name="extent-string"/>
</xsl:if>
</xsl:template>
Expand Down
8 changes: 7 additions & 1 deletion teihi.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<xsl:template match="t:hi">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:choose>
<xsl:when test="@rend='ligature'">
<xsl:choose>
Expand Down Expand Up @@ -46,7 +47,12 @@
<xsl:when test="$parm-apparatus-style = 'ddbdp'">
<!-- found in [htm|txt]-tpl-apparatus.xsl -->
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
Expand Down
10 changes: 8 additions & 2 deletions teimilestone.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@

<xsl:template match="t:milestone[@rend = 'box']">
<xsl:param name="parm-apparatus-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" tunnel="yes" required="no"/>
<xsl:if test="$parm-apparatus-style = 'ddbdp'">
<!-- Adds links/indication to apparatus - found in [htm|txt]-tpl-apparatus -->
<xsl:call-template name="app-link">
<xsl:with-param name="location" select="'text'"/>
<xsl:call-template name="app-link">
<xsl:with-param name="location">
<xsl:choose>
<xsl:when test="$location = 'apparatus'">apparatus</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
Expand Down
Loading

0 comments on commit ff6f364

Please sign in to comment.