[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Incrementing number in a for loop ??

Subject: RE: Incrementing number in a for loop ??
From: Dipesh Khakhkhar <dkhakhkh@xxxxxxxxxxxxxxx>
Date: Thu, 31 Jul 2003 14:06:56 -0400
xsl loop count
Hi Ken,

Thanks a mile. This is exactly what i was trying to do.

Thanks !!
Regards,
Dipesh

Date: Thu, 31 Jul 2003 10:41:43 -0400
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Subject: RE:  Incrementing number in a for loop ??

At 2003-07-31 09:44 -0400, Dipesh Khakhkhar wrote:
>When i m parsing my xsl file i m creating quotes like this and it is
>HARDCODED
>and this I counted and put into my xsl file as show below where at
>someplace i
>need like this.
>
><xsl:text>
>``````````````````````````````</xsl:text>
>And at other place i need something like this.
><xsl:text>
>``````</xsl:text>
>...
>int quoteCount = 30; // for example this many quotes i need
>for(int i = 0; i < quoteCount ; i++)
> printf("`");

I hope this helps.

............ Ken

T:\ftemp>type dipesh.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="text"/>

<xsl:template match="/">
<xsl:text>First is 30: </xsl:text>
<xsl:call-template name="do-quotes">
<xsl:with-param name="count" select="30"/>
</xsl:call-template>
<xsl:text>&#xa;Second is only 20: </xsl:text>
<xsl:call-template name="do-quotes">
<xsl:with-param name="count" select="20"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="do-quotes">
<xsl:param name="count" select="0"/>
<xsl:if test="$count">
<xsl:text>'</xsl:text>
<xsl:call-template name="do-quotes">
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
T:\ftemp>saxon dipesh.xsl dipesh.xsl
First is 30: ''''''''''''''''''''''''''''''
Second is only 20: ''''''''''''''''''''
T:\ftemp>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.