Subject: Re: [xsl] count elements in variable From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 15 Oct 2013 09:52:40 +0100 |
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
<xsl:variable name="docKey"> <xsl:value-of select="count(preceding::tei:msDesc)"/>
-- google plus: https:/profiles.google.com/d.p.carlisle
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] count elements in variable, Torsten Schassan | Thread | [xsl] Using Saxon 2.0 with FOP, XEP, Jesper Tverskov |
[xsl] count elements in variable, Torsten Schassan | Date | [xsl] Using Saxon 2.0 with FOP, XEP, Jesper Tverskov |
Month |