cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariusz Nowostawski <mari...@marni.otago.ac.nz>
Subject [xslt] element counting
Date Mon, 12 Jun 2000 03:45:19 GMT
Sorry for being slightly off topic here, but is there any other way to
count (get the number of) particular children of a given element other
than iterating through those children and grabing the last element
position()?

At the moment I am doing:

<xsl:for-each select="someTag">
   <xsl:if test="position()=last()">
     do smth with <xsl:value-of select="position()"/>
   </xsl:if>
</xsl:for-each>

but it seems to me kind of way around. 
I do not know how to build expression which returns the position of the
last "someTag" element, is it possible?
I have read about <xsl:number>, but I could not make it to work either in
this case, I do not want to "iterate", I just want the total number.

Any suggestions?

--
Mariusz


Mime
View raw message