<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tei-c.org/index.php?action=history&amp;feed=atom&amp;title=Count_Metrical_Lines_P5.xslt</id>
	<title>Count Metrical Lines P5.xslt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tei-c.org/index.php?action=history&amp;feed=atom&amp;title=Count_Metrical_Lines_P5.xslt"/>
	<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;action=history"/>
	<updated>2026-12-04T23:07:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.4</generator>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3918&amp;oldid=prev</id>
		<title>Piotr Banski: Reverted edit of JvwJ8e, changed back to last version by Piotr Banski</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3918&amp;oldid=prev"/>
		<updated>2007-12-05T08:40:31Z</updated>

		<summary type="html">&lt;p&gt;Reverted edit of JvwJ8e, changed back to last version by Piotr Banski&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3401&amp;oldid=prev</id>
		<title>Piotr Banski: Reverted edit of JvwJ8e, changed back to last version by Piotr Banski</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3401&amp;oldid=prev"/>
		<updated>2007-09-03T11:00:17Z</updated>

		<summary type="html">&lt;p&gt;Reverted edit of JvwJ8e, changed back to last version by Piotr Banski&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3205&amp;oldid=prev</id>
		<title>Piotr Banski: revert</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3205&amp;oldid=prev"/>
		<updated>2007-06-13T10:01:34Z</updated>

		<summary type="html">&lt;p&gt;revert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3199&amp;oldid=prev</id>
		<title>Piotr Banski: revert</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3199&amp;oldid=prev"/>
		<updated>2007-06-10T20:09:11Z</updated>

		<summary type="html">&lt;p&gt;revert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3113&amp;oldid=prev</id>
		<title>Piotr Banski: yet another revert</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3113&amp;oldid=prev"/>
		<updated>2007-04-11T16:05:41Z</updated>

		<summary type="html">&lt;p&gt;yet another revert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3105&amp;oldid=prev</id>
		<title>Piotr Banski: revert (vandalism)</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=3105&amp;oldid=prev"/>
		<updated>2007-04-11T10:11:53Z</updated>

		<summary type="html">&lt;p&gt;revert (vandalism)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:XSLT]]&lt;/div&gt;</summary>
		<author><name>Piotr Banski</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=2500&amp;oldid=prev</id>
		<title>Syd: put in correct category</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=2500&amp;oldid=prev"/>
		<updated>2006-02-20T19:32:02Z</updated>

		<summary type="html">&lt;p&gt;put in correct category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:32, 20 February 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot;&gt;Line 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:XSLT]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Syd</name></author>
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=2499&amp;oldid=prev</id>
		<title>Syd: Initial upload of stylesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Count_Metrical_Lines_P5.xslt&amp;diff=2499&amp;oldid=prev"/>
		<updated>2006-02-20T19:29:19Z</updated>

		<summary type="html">&lt;p&gt;Initial upload of stylesheet&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Counting &amp;amp;lt;l&amp;gt; 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 &amp;amp;lt;l&amp;gt; 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;amp;amp; prev= attributes. This stylesheet counts metrical lines in a TEI P5 document, taking into consideration those that have been encoded using several &amp;amp;lt;l&amp;gt; elements using these mechanisms. It does not take other mechanisms (e.g., &amp;amp;lt;join&amp;gt;) into account.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!-- Count lines of poetry, P5 version --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Conceived and written 2006-02-19 by Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Copyleft 2006 Syd Bauman --&amp;gt;&lt;br /&gt;
&amp;lt;xsl:stylesheet xmlns:tei=&amp;quot;http://www.tei-c.org/ns/1.0&amp;quot;&lt;br /&gt;
  xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;br /&gt;
  xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot; version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:output method=&amp;quot;text&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Only look at &amp;lt;l&amp;gt; elements inside the outermost &amp;lt;text&amp;gt; element --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (Not likely that there are &amp;lt;l&amp;gt; elements in the &amp;lt;teiHeader&amp;gt;, but --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- you never know.) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;/tei:TEI/tei:text&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;There are &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- count all lines that do not claim to be continuations of another line elsewhere --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:value-of select=&amp;quot;count(.//tei:l[not(@prev) and not(@part=&amp;#039;M&amp;#039;) and not(@part=&amp;#039;F&amp;#039;)])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt; metrical lines in “&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates&lt;br /&gt;
      select=&amp;quot;/tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title[@type=&amp;#039;main&amp;#039; or not(@type)][1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;”&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;l&amp;gt; with part=&amp;quot;Y&amp;quot; are metrically incomplete lines, which need to be reported separately --&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:variable name=&amp;quot;incomplete&amp;quot; select=&amp;quot;count(.//tei:l[@part=&amp;#039;Y&amp;#039;])&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:if test=&amp;quot;$incomplete &amp;gt; 0&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt;, of which &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:value-of select=&amp;quot;$incomplete&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;!-- singular or plural? --&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:when test=&amp;quot;$incomplete = 1&amp;quot;&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; is&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;
	&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;
	  &amp;lt;xsl:text&amp;gt; are&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
	&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;
      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;
      &amp;lt;xsl:text&amp;gt; incomplete&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
    &amp;lt;/xsl:if&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:text&amp;gt;.&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- for a &amp;lt;title&amp;gt;, just return the string-value of its children --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- (We don&amp;#039;t have to worry about this template applying except --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- when we ask for it, above, because any other ancestor will --&amp;gt;&lt;br /&gt;
  &amp;lt;!-- be completely ignored anyway (see below).) --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;tei:title&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsl:apply-templates/&amp;gt;&lt;br /&gt;
  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;!-- Just ignore most anything and everything else --&amp;gt;&lt;br /&gt;
  &amp;lt;xsl:template match=&amp;quot;*&amp;quot;/&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Syd</name></author>
	</entry>
</feed>