RE: Node with maximum attribute value

Subject: RE: Node with maximum attribute value
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 21 Feb 2000 18:34:41 -0000
> Subject: Re: Node with maximum attribute value
> >  use a sorted for-each, ... then use
> 
> <xsl:if test="position()=last()">maximum = <xsl:value-of 
> select="@mid"/></xsl:if>
> 

Interesting to compare this with the recursive solution I just submitted. An
optimum implementation of the recursive algorithm would have linear
performance whereas the above has n*log(n). But most implementations of the
recursive algorithm (certainly Saxon) will probably have O(n*n) performance,
because of the xsl:with-param select="nodes[position()!=1]". JC's lazy
evaluation will probably score well here.

Mike Kay


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


Current Thread