[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

number of particular sub elements

Subject: number of particular sub elements
From: "John Smith" <debrief@xxxxxxxxx>
Date: Sun, 9 Sep 2007 12:32:32 +0100
 number of particular sub elements
Hello,

how can I retrieve the number of children in the context node and set
it as variable, or the parameter?

instead of this:

<xsl:template name="aName">
	<xsl:param name="max" select="last()" />
...
</xsl:template>


I want to do something like this, (the code below is incorrect and
only serves as a mean to describe what I am trying to achive)


<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:

<x>
    <z />
    <y />
    <z />
    <y />
    <z />
</x>

So want to get the number of 'y' elements which in this case is 2.

Thanks,
J

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.