[xsl] Re:[xsl] Sort By calclulated variable

Subject: [xsl] Re:[xsl] Sort By calclulated variable
From: "Giancarlo Rossi" <giancarlo_rossi@xxxxxxxxxx>
Date: Mon, 4 Sep 2006 15:04:14 +0200
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