|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Calculation of Minimum or Maximum value of an ele
Here are four techniques you can use:
1. Use the XPath expression
A[not(../A < .)]
which finds all A elements that have no other A whose value is
smaller. This expression has quadratic performance.
2. Sort the list and (using the xx:node-set() extension) select the
first or last in sorted order. This has (n log n) performance.
3. Use a recursive template. This has linear performance.
4. Use a library routine, such as the EXSLT min() function: see
www.exslt.org.
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Chitra Lalita Madhwacharyula
> Sent: 12 November 2002 01:46
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Calculation of Minimum or Maximum value of an element
>
>
>
> Hello,
>
> Can anyone please tell me how to calculate the minimum or
> maximum values of a set of nodes and display them using XSLT ?
> For e.g if I have
> <A>300</A>
> <A>250</A>
> <A>900</A>
> How can I write a template or a function which
> calculates the least A element value and displays it ???
>
> Thanx,
> Chitra
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
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
|

Cart








