[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: counting in for each
The usual way to handle such requirements is with code such as this: <xsl:for-each select="item"> <xsl:choose> <xsl:when test="position() mod 2 = 0">...</xsl:when> <xsl:otherwise>...</xsl:otherwise> </xsl:choose> </xsl:for-each> Withing the for-each, the total number of items is available as the result of the function last(). Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Dietmar Klotz [mailto:dklotz@xxxxxxxxxxx] > Sent: 09 December 2005 20:12 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: counting in for each > > > I am making a list with "for each" and if the list is 1 or 3 > items it should > change the state of display. And I would also like to change the Icon > depending on how many objects there are....so object 1 has > icon 1...object 2 > icon 2 > > So my question. Is it possible to count how many Items there > are in a node? > And do I know where I am in a for each? > > Thanks to all! > > Dietmar Klotz
|
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
|