Skip to content

Commit

Permalink
Merge pull request #458 from Edirom/issue-456
Browse files Browse the repository at this point in the history
check for xml:lang when counting divs
  • Loading branch information
peterstadler authored Apr 24, 2024
2 parents 6ada1c2 + c8cc57e commit 6c486b6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion xsl/var.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,18 @@
<xsl:with-param name="dot" select="true()"/>
</xsl:call-template>
</xsl:if>
<xsl:value-of select="count($div/preceding-sibling::tei:div[not(following::tei:divGen)][tei:head][ancestor-or-self::tei:div/@xml:lang=$lang]) + 1 +$offset"/>
<xsl:variable name="preceding-divs" as="node()*">
<!-- when xml:lang information is present only the respective divs need to be taken into account -->
<xsl:choose>
<xsl:when test="$div/ancestor-or-self::tei:div/@xml:lang">
<xsl:sequence select="$div/preceding-sibling::tei:div[not(following::tei:divGen)][tei:head][ancestor-or-self::tei:div/@xml:lang=$lang]"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$div/preceding-sibling::tei:div[not(following::tei:divGen)][tei:head]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="count($preceding-divs) + 1 +$offset"/>
<xsl:if test="$dot">
<xsl:text>.&#8201;</xsl:text>
</xsl:if>
Expand Down

0 comments on commit 6c486b6

Please sign in to comment.