This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: get the max-value
- From: Antonio Fiol <fiol at w3ping dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 13 Jun 2002 11:06:15 +0200
- Subject: Re: [xsl] get the max-value
- References: <36885FC2A38EEA4098A91C29117F00370972CA@Z1IN054H.hdi.de>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Oops!!
I had not seen that you have many Characteristic elements. I thought you
only had one of them.
Let me guess:
//Data/Characteristic/Value[not(//Data/Characteristic/Value > .)]
I think this should work (maybe with number() as in my wrong post).
Try to avoid the // if you can specify the right path to your Data element.
There may exist a more optimal Xpath for the comparison inside the
not(). However, I am not a specialist in XSLT optimization.
AFAIR, cost of this approach should be nē.
You may be able to get it in n.log(n) by restricting that Xpath expression.
Antonio
Pfitzner, Jan wrote:
Hi,
I want to get the maximum value in my xml-file.
xml:
<Data>
<Characteristic>
<Value>9879</Value>
<Value>93425</Value>
<Value>23465</Value>
<Value>234</Value>
<Value>1235</Value>
<Value>96569</Value>
...
</Characteristic>
<Characteristic>
<Value>1239</Value>
...
</Characteristic>
...
</Data>
I tried it with xsl:for-each and xsl:sort, but I didn't managed.
Thanks
JP
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list