[xsl] counting specific nodes

Subject: [xsl] counting specific nodes
From: "james walker" <jameswalkerandy@xxxxxxxxxxx>
Date: Wed, 15 Oct 2003 13:23:37 +0100
given the xml
<ve pos="1"></ve>
<ve pos="1.1"></ve>
<ve pos="1.1.1"></ve>
<ve pos=""></ve>
<ve pos=""></ve>
<ve pos=""></ve>
<ve pos"1.2"></ve>
<ve pos="1.2.1"></ve>
<<ve pos=""></ve>
<ve pos="2"></ve>
<ve pos="2.1"></ve>
<ve pos="2.1.1"></ve>
<ve pos=""></ve>

and given that i am starting on a node with pos=1 (or 2 or 3....), how do i count the nodes which have position with 3 dots only (e.g. pos= and start with the current node position. I came up with something like this:

<xsl:variable name="rowspan" select="count(ve[starts-with(@position, current()/@position) and contains(...........)])" />
e.g. for position 1, it should be 4 ( ,,,

Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread