Skip to content

Commit

Permalink
Fix bug in output of hi siblings. DCLP/dclpxsltbox#118
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalesky committed Jun 8, 2017
1 parent e737b28 commit 31b5e4d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions example-p5-xslt/tpl-apparatus.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,46 +1182,46 @@
<xsl:template name="hirend">
<!-- prints the value of diacritical <hi> values, either in text (with full word context, called from teihi.xsl) or in app (highlighted character only) -->
<xsl:param name="hicontext" select="'yes'"/>

<xsl:if test="$hicontext != 'no'">
<xsl:variable name="text-before">
<xsl:choose>
<xsl:when test="not(preceding-sibling::node()[1])">
<xsl:call-template name="recurse_back">
<xsl:with-param name="step" select="parent::*"/>
<xsl:with-param name="step" select="parent::*/preceding-sibling::node()[1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="recurse_back">
<xsl:with-param name="step" select="preceding-sibling::node()[1]"/>
<xsl:with-param name="step" select="preceding-sibling::node()[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- This removes unnecessary line breaks that could've come through -->
<xsl:value-of select="normalize-space($text-before)"/>
</xsl:if>

</xsl:if>
<xsl:call-template name="hirend_print"/>

<xsl:if test="$hicontext != 'no'">
<xsl:choose>
<xsl:when test="not(following-sibling::node()[1])">
<xsl:call-template name="recurse_forward">
<xsl:with-param name="step" select="parent::*"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="recurse_forward">
<xsl:with-param name="step" select="following-sibling::node()[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:when test="not(following-sibling::node()[1])">
<xsl:call-template name="recurse_forward">
<xsl:with-param name="step" select="parent::*/following-sibling::node()[1]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="recurse_forward">
<xsl:with-param name="step" select="following-sibling::node()[1]"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<!-- found below: inserts "papyrus" or "ostrakon" depending on filename -->
<xsl:call-template name="support"/>
</xsl:if>

</xsl:template>


<xsl:template name="hirend_print">
<!-- Determines the value of diacritical <hi> values -->
Expand Down

0 comments on commit 31b5e4d

Please sign in to comment.