Subject: RE: [xsl] Calculation of Minimum or Maximum value of an element From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 12 Nov 2002 09:33:09 -0000 |
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: [xsl] 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Calculation of Minimum o, Mike Brown | Thread | [xsl] Using Javascript with XSL, Chitra Lalita Madhwa |
RE: [xsl] Navigationg thru XML Elem, bryan | Date | RE: [xsl] Storing calculated values, Michael Kay |
Month |