[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 ??
Hi Markus, Thanks once again for replying. I finally got it. I used full path for the child element i.e count(OBJECT/ATTRIBUTE) and took the generated id for the OBJECT node. Previously i was running two for loop i.e. one for the CLASS node which is the parent of the OBJECT node and then one for OBJECT node and I was getting generated id for the two object nodes and because of that only i was not getting the node which i was looking for. I removed one for loop for OBJECT node and finally got the node with maximum children of type ATTRIBUTE. Thanks for taking out time to reply me. Highly appreciated. Regards, Dipesh Date: Thu, 28 Aug 2003 20:21:30 +0200 From: Markus Abt <abt@xxxxxxxx> Subject: AW: how to get node with maximum 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|