[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Maximum number of cells
Mark,
So far as I know, the only way in XSLT 1.0 is to have a recursive named template visit each row in turn, saving up the value of the largest as it goes. Nasty, but it does the job. For example, <xsl:template match="/"> <xsl:call-template name="mostCells"/> </xsl:template> <xsl:template name="mostCells"> <xsl:param name="rowsToGo" select="//rows"/> <xsl:param name="mostCellsSoFar" select="0"/> <xsl:if test="rowsToGo"> <xsl:call-template name="mostCells"> <xsl:with-param name="rowsToGo" select="$rowsToGo[position() > 1]"/> <xsl:with-param name="mostCellsSoFar"> <xsl:choose> <xsl:when test="count(cell) > $mostCellsSoFar"> <xsl:value-of select="count(cell)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$mostCellsSoFar"/> </xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> </xsl:if> <xsl:value-of select="$mostCellsSoFar"/> </xsl:template> (This code is untested, though I've used the algorithm successfully elsewhere.) It'd be nice to have a neater way. Anyone? At 04:30 PM 12/20/00 -0500, you wrote: Hello,
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
|