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

Re: Sort By calclulated variable

Subject: Re: Sort By calclulated variable
From: "Giancarlo Rossi" <giancarlo_rossi@xxxxxxxxxx>
Date: Mon, 4 Sep 2006 15:04:14 +0200
by price download sort
Hi David ,
I'm sorry but Someone tell me to open a new 3d
With the right titol problem name.

So I did it...


My processor is 1.0 with msxml.

I need to sort a document by price... 

But sometimes In the xml document the price is not in the same node.
Infact with this variable I'm able to get the price value and display it.

<xsl:variable name="totale">
<xsl:choose>
<xsl:when test="Price/Amount">
<xsl:value-of
select="format-number(number(Price/Amount)+number($root/Price/Amount),'#.##'
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Group/Price/Amount/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>


But the sorting must be calculated in the same way, beacouse the value 
could be inside
format-number(number(Price/Amount)+number($root/Price/Amount)
Or in //Group/Price/Amount/text()

So if I ask to do a sorting by <xsl:sort select="Price/Amount" /> the Item
with the price value inside //Group/Price/Amount/text() not will be sorted.

I hope is clear now..........

The document is here: www.lastminutesud.it/test/901968736.xml

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.