XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
giancarlo rossiSubject: get the current position as parameter
Author: giancarlo rossi
Date: 10 Sep 2006 06:06 AM
have this
situation:

<xsl:for-each select="../../ReturnList/Return" >
xsl:sort="sum(../../OutwardList/Outward[$pos]/Price/Amount|../../ReturnList­/Return[position()]/Price/Amount|$prezzo_gruppo)"
order="ascending" data/type="number" /><br/>
</xsl:for-each>


but the sum is not right becouse the position value is not understanded
from xpath...


I check it by a comparing:


<xsl:for-each select="../../ReturnList/Return" >
<xsl:variable name="posrt" select="position()" />
<xsl:value-of
select="sum(../../OutwardList/Outward[$pos]/Price/Amount|../../ReturnList/R­eturn[$posrt]/Price/Amount|$prezzo_gruppo)"
/><br/>


<xsl:value-of
select="sum(../../OutwardList/Outward[$pos]/Price/Amount|../../ReturnList/R­eturn[position()]/Price/Amount|$prezzo_gruppo)"
/><br/>


</xsl:for-each>


Wich is the right way to get the "position()" value in this case
without using a variable?


Posttop
James DurningSubject: get the current position as parameter
Author: James Durning
Date: 11 Sep 2006 10:17 AM
Are you trying to get something like:
position() = current()/position()

I personally prefer the variable method however.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.