[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: get the max-value

Subject: Re: get the max-value
From: Antonio Fiol <fiol@xxxxxxxxxx>
Date: Thu, 13 Jun 2002 11:06:15 +0200
xpath get max value
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.