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

Re: for loop

Subject: Re: for loop
From: "Mitch C. Amiano" <Mitch.Amiano@xxxxxxxxxxx>
Date: Mon, 10 Dec 2001 13:45:47 -0500
xsl loop
I noticed another reply where a filter was used to emulate a loop.
This is nice, but requires some prior knowledge of the input. 

Based on another note you sent, I would suggest that you consider
finding some way to shift the responsibility for looping away
from XSLT and onto SVG code.  

Charly wrote:

> 
> I writting a template that draws a 3D bar chart using fo and svg.
> One of the arguments is the number of gradiations.
> I want to have a loop that draws the specified number .
> 

and also 

> 
> Thanks Mitch, that helps a lot .
> 
> ----- Original Message -----
> From: "Mitch C. Amiano" <Mitch.Amiano@xxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, December 10, 2001 9:26 AM
> Subject: Re:  for loop
> 
> > There is no direct expression for this, but you can accomplish
> > the same thing using a recursive template.
> >
> > <?xml version="1.0"?>
> > <xsl:stylesheet
> >    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >    version="1.0"
> > >
> > <xsl:preserve-space elements="*"/>
> > <xsl:output method="text"/>
> >
> > <xsl:template match="/">
> >  <xsl:call-template name="loop">
> >   <xsl:with-param name="repeat" select="number(10)"/>
> >  </xsl:call-template>
> > </xsl:template>
> >
> > <xsl:template name="loop">
> >  <xsl:param name="repeat">0</xsl:param>
> >  <xsl:if test="number($repeat) >= 1">
> > Loop Iteration # <xsl:value-of select="$repeat"/>
> >   <xsl:call-template name="loop">
> >    <xsl:with-param name="repeat" select="$repeat - 1"/>
> >   </xsl:call-template>
> >  </xsl:if>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > You may want to consider why you want a loop though.
> > Often, there is a structure in your input that can be
> > used to drive the output, and for that you just need
> > an XPath.
> >
> > Charly wrote:
> > >
> > > Hello,
> > > does anyone knows how to make a loop for in xsl.
> > > Something more like .
> > >
> > >    <xsl:loop name="i" from="1" to="10" step="1">
> > >       $i
> > >    </xsl:loop>
> > >
> > > Please help
> > >
> > >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> > --
> > Mitch.Amiano (@alcatel.com)
> > SW Development Engineer in C++/Java/Perl/TCL/SQL/XML/XSLT/XPath
> > Advance Design Process Group, Raleigh Engineering Services     Alcatel
> > USA
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--
Mitch.Amiano (@alcatel.com)
SW Development Engineer in C++/Java/Perl/TCL/SQL/XML/XSLT/XPath
Advance Design Process Group, Raleigh Engineering Services     Alcatel
USA

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


Current Thread
  • for loop
    • Charly - Mon, 10 Dec 2001 12:01:54 -0500 (EST)
      • Mitch C. Amiano - Mon, 10 Dec 2001 12:27:06 -0500 (EST)
        • Charly - Mon, 10 Dec 2001 13:07:39 -0500 (EST)
          • Mitch C. Amiano - Mon, 10 Dec 2001 13:46:07 -0500 (EST) <=
      • Oleg Tkachenko - Mon, 10 Dec 2001 12:34:40 -0500 (EST)
        • Charly - Mon, 10 Dec 2001 13:04:50 -0500 (EST)

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.