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
Posttop
giancarlo rossiSubject: 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 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.