xsl-list
[Top] [All Lists]

[xsl] count elements in variable

2013-10-15 03:09:37
Hi there,


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

<xsl:variable name="descriptions"
select="collection(iri-to-uri('file:///d:/mss?select=tei-msDesc.xml;recurse=yes'))"/>



Next I process single elements:

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



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)"/>
 </xsl:variable>
...
</xsl:template>


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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>