xsl-list
[Top] [All Lists]

Re: [xsl] number of particular sub elements

2007-09-09 05:10:57
John Smith wrote:
<xsl:template name="aName">
        <xsl:param name="max" select="particularSubElements.last()" />
....
</xsl:template>

so if the context node was 'x' I want to the number of 'y' sub elements:

count(y)

and change the param in your named template to be a variable if you don't mean the caller to set the amount for you:

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

Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>