Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
XSLT Help and Discussion
»
get a variable as a constant
Topic
Topic Page
1
2
3
4
5
6
7
8
9
Prev Topic
Next Topic
top
Subject:
get a variable as a constant
Author:
giancarlo rossi
Date:
25 Oct 2006 09:46 AM
Originally Posted: 25 Oct 2006 09:35 AM
<xsl:for-each select="msxsl:node-set($base)/item[(supplier = $supplier_param or not($supplier_param)) ">
<xsl:sort select="totale_finale" data-type="number" order="ascending" />
<xsl:variable name="min" >
<xsl:if test="position()=1">
<xsl:value-of select="totale_finale" />
</xsl:if>
</xsl:variable>
<xsl:if test="$min=totale_finale">
do something
<xsl>
</xsl:for-each>
You know that a variable in this case is not a constant , so it change depending from position().
So,
How it is possible get a variable as a constant in xslt 1.0 ?
I think it should be possible in this way:
<xsl:value-of select="item[position() = 1]/totale_finale" />
where my xml fragment is:
<item>
<totale_finale>500</totale_finale>
</item>
<item>
<totale_finale>600</totale_finale>
</item>
<item>
<totale_finale>300</totale_finale>
</item>
but is not correct...
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.