cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, gonghui" <gw...@houston.geoquest.slb.com>
Subject Re: [xslt] element counting
Date Mon, 12 Jun 2000 12:34:53 GMT
try count(soneTag), it seems to work

Mariusz Nowostawski wrote:

> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message