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

AW: how to get node with maximum child nodes ??

Subject: AW: how to get node with maximum child nodes ??
From: Markus Abt <abt@xxxxxxxx>
Date: Thu, 28 Aug 2003 20:21:30 +0200
xsl count child nodes
Hi Dipesh,

you have 2 <CLASS NAME="Client_Agent> elements in your XML.
For each, you find the maximum ATTRIBUTE element count in OBJECT elements.
So you get 2 values.

If you want to get the overall maximum, do:

<xsl:for-each select="//CLASS[normalize-space(@NAME)='Client_Agent']/OBJECT">
	<xsl:sort select="count(ATTRIBUTE)" order="descending"/>
		<xsl:if test="position()=1">
			<xsl:value-of select="generate-id(.)"/>
		</xsl:if>
</xsl:for-each>


Regards,
Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


----------
Von: 	Dipesh Khakhkhar
Gesendet: 	Donnerstag, 28. August 2003 17:38
An: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: 	 how to get node with maximum child nodes ??

[...]
<xsl:for-each select="//CLASS">
	<xsl:choose>
		<xsl:when test="normalize-space(@NAME)='Client_Agent'">
			<xsl:for-each select="OBJECT">
				<xsl:sort select="count(ATTRIBUTE)" order="descending"/>
					<xsl:if test="position()=1">
						<xsl:value-of select="generate-id(.)"/>
					</xsl:if>
			</xsl:for-each>
		</xsl:when>
	</xsl:choose>
</xsl:for-each>
[...]


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


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.