Count Metrical Lines P5.xslt

Counting &lt;l> elements in a TEI document is pretty easy. But when a metrical line is broken in order to handle overlap, e.g., often two or more TEI &lt;l> elements are used to represent a single metrical line. There are several mechanisms for indicating this fact, two of the more common of which are the use of the part= attribute and the use of the next= &amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &lt;l> elements using these mechanisms. It does not take other mechanisms (e.g., &lt;join>) into account. 





  

 There are    metrical lines in “  ”  <xsl:if test="$incomplete > 0"> , of which </xsl:text> <xsl:value-of select="$incomplete"/> <xsl:choose> <xsl:when test="$incomplete = 1">  is</xsl:text> </xsl:when> <xsl:otherwise>  are</xsl:text> </xsl:otherwise> </xsl:choose>  incomplete</xsl:text> </xsl:if> .</xsl:text> </xsl:template>

 <xsl:apply-templates/> </xsl:template>  </xsl:stylesheet>