|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Finding min and max
> I need help with finding min & max value in a nodeset based > on the account > type (I and R) AND minimum and maximum value in a nodeset (no > matter what > the account type is). Well, you presumably know how to select the nodes that satisfy the relevant condition, e.g. record[Account='I']/High. Given a node-set, there are several ways you can find the min and max value: * In XPath 2.0, use the min() and max() functions. * Sort the nodes, and choose the first and last in sorted order * Do a scan of the nodes using a recursive template, keeping track of the highest and lowest so far. The third approach is probably the most efficient because you can get the min and max in a single scan, but it's also the hardest one to code, especially for a beginner. Michael Kay > Anybody can help ? > > The xml structure is like this: > > <Trade> > <Record> > <Account>R</Account> > <High>1000</High> > </Record> > <Record> > <Account>R</Account> > <High>2000</High> > </Record> > <Record> > <Account>I</Account> > <High>5000</High> > </Record> > <Record> > <Account>I</Account> > <High>2000</High> > </Record> > </Trade> > > Any help will be appreciated > > _________________________________________________________________ > Help STOP SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail
|
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








