This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Node with maximum attribute value


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]