This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Node with maximum attribute value
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Node with maximum attribute value
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Mon, 21 Feb 2000 18:34:41 -0000
- Reply-To: xsl-list at mulberrytech dot com
> 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