[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] count elements in variable

Subject: [xsl] count elements in variable
From: Torsten Schassan <schassan@xxxxxx>
Date: Tue, 15 Oct 2013 10:09:10 +0200

Hi there,

I define a variable and traverse through a folder to collect files which
I want to process. (XSLT2)

<xsl:variable name="descriptions"

Next I process single elements:

<xsl:apply-templates select="$descriptions/descendant::tei:msDesc">
  <xsl:sort select="descendant::tei:msIdentifier/tei:idno/@sortKey"/>

Within the template I want to add a running number to each element:

<xsl:template match="tei:msDesc">
 <xsl:variable name="docKey">
   <xsl:value-of select="count(preceding::tei:msDesc)"/>

But this last step simply doesn't work. Does anybody have a clue what
I'm missing here?

Best, Torsten

Torsten Schassan
Digitale Editionen
Abteilung Handschriften und Sondersammlungen
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130 (Fax -165), schassan {at} hab.de

Handschriftendatenbank: http://diglib.hab.de/?db=mss

Current Thread