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
Arnt MobergSubject: Regarding combocounter PLEASE HELP
Author: Arnt Moberg
Date: 19 Apr 2005 07:07 PM
I want the following code to count from 0 to @maxpoint instead of from 1 to maxpoint but I get errors doing this... And I cant find it. can anyone please help..
The counting template follows here and the whole xsl and xml file follows as an attachment.

I am very grateful if u can help me with this!

<xsl:template name="combo"><xsl:param name="count" select="1"/><xsl:param name="limit"/>
<xsl:when test="$count = 1">
<select style="width: 90px; height: 26px">
<xsl:if test="$limit &gt; 1">
<xsl:call-template name="combo"><xsl:with-param name="count" select="$count + 1"/><xsl:with-param name="limit" select="$limit"/></xsl:call-template>
<xsl:value-of select="@maxpoint"/>
<xsl:when test="$count &lt; $limit">
<xsl:value-of select="$count"/>
<xsl:call-template name="combo">
<xsl:with-param name="count" select="$count + 1"/>
<xsl:with-param name="limit" select="$limit"/>



(Deleted User) Subject: Regarding combocounter PLEASE HELP
Author: (Deleted User)
Date: 20 Apr 2005 08:34 AM
not sure what you are trying to archieve from the code, but the default value of parameter 'count' is set to 1. and your first call of combo template start from the default value.

you need to set it to 0 if you really want it to start from 0, like

<xsl:template name="combo">
<xsl:param name="count" select="0"/>

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!  

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.