RE: [xsl] number of particular sub elements

Subject: RE: [xsl] number of particular sub elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 9 Sep 2007 13:07:06 +0100
> so if the context node was 'x' I want to the number of 'y' 
> sub elements:
> 
> <x>
>     <z />
>     <y />
>     <z />
>     <y />
>     <z />
> </x>
> 
> So want to get the number of 'y' elements which in this case is 2.


<xsl:variable name="count-of-y" select="count(y)"/>

Michael Kay
http://www.saxonica.com/

Current Thread