Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
XSLT Help and Discussion
»
for each with a parallel nodelist
Topic
Topic Page
1
2
3
4
5
6
7
8
9
Prev Topic
Next Topic
next
Subject:
for each with a parallel nodelist
Author:
giancarlo rossi
Date:
31 Aug 2006 12:31 PM
Hi...
I have this situation:
<xsl:for-each select="/CommandList/CheckRouting/RouterList/Router[Complete='true']/GroupList/Group/OutwardList/Outward" > <xsl:variable name="root" select="/CommandList/CheckRouting/RouterList/Router[Complete='true']/GroupList/Group/ReturnList/Return" />
<xsl:variable name="totale">
<xsl:choose>
<xsl:when test="Price/Amount">
<xsl:value-of select="number(Price/Amount)"/> + <xsl:value-of select="number($root/Price/Amount)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Group/Price/Amount/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each>
The problem is <xsl:value-of select="number($root/Price/Amount)"/>
Return the same results...
It should be following for each order and display the relative result.
The document: www.lastminutesud.it/test/901968736.xml
next
Subject:
for each with a parallel nodelist
Author:
Ivan Pedruzzi
Date:
01 Sep 2006 12:09 AM
Giancarlo,
The variable $root is assigned to an absolute expression that is not influenced by the context.
/CommandList/CheckRouting/RouterList/Router[Complete='true']/GroupList/Group/ReturnList/Return"
Considering that your context element is "Outward" may be you want
<xsl:variable name="root" select="../ReturnList/Return" />
Hope this helps
Ivan Pedruzzi
Stylus Studio Team
top
Subject:
for each with a parallel nodelist
Author:
giancarlo rossi
Date:
01 Sep 2006 06:14 PM
Yes it works but now I found a sort problem...
It possible to sort by <xsl:variable name="totale"> ?
<xsl:variable name="rootOW" select="/CommandList/CheckRouting/RouterList/Router[Complete='true']/GroupList/Group/OutwardList/Outward" />
<xsl:for-each select="$rootOW" >
<xsl:variable name="root" select="../../ReturnList/Return" />
<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>
'my code..
</xsl:for-each>
Topic Page
1
2
3
4
5
6
7
8
9
Prev Topic
Next Topic
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 to Conference:
Select Conference
Stylus Studio Feature Requests
Stylus Studio Technical Forum
Website Feedback
XSLT Help and Discussion
XQuery Help and Discussion
Stylus Studio FAQs
Stylus Studio Code Samples & Utilities
Stylus Studio Announcements
go
Log In Options
Username:
Password:
Site Map
|
Privacy Policy
|
Terms of Use
|
Trademarks
Stylus Scoop XML Newsletter:
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.