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

Re: newbie qtn: best way to display a specific range o

Subject: Re: newbie qtn: best way to display a specific range of records (say, 5-10, or whatever)
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Wed, 19 Sep 2001 14:57:43 +0100
specific range
here is a simple example of using called templates that outputs line breaks
( by evan lenz, from xslt faq )


this code calls the template 5 times

  <xsl:call-template name="line-breaks">
      <xsl:with-param name="n" select="5"/>
    </xsl:call-template>


here  is the named template
<xsl:template name="line-breaks">
  <xsl:param name="n"/>
  <xsl:if test="number($n) > 0">
    <br/>
    <xsl:call-template name="line-breaks">
      <xsl:with-param name="n" select="number($n) - 1"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>

though i am certain there are other methods.

u may also want to review your data format, do u really need to iterate ?

cheers ,jim fuller

----- Original Message -----
From: "Clark Freifeld" <clark@xxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, September 19, 2001 8:51 PM
Subject:  newbie qtn: best way to display a specific range of records
(say, 5-10, or whatever)


> Hello all. I have just subscribed to the list, I am a newbie to XSL. My
> question is as follows:
>
> Ideally what I want to do is something like this:
>
> <xsl:for-each select="//data/job" startwith="//params/startrecord"
> numrecords="//params/numrecords">
>   A 'job' in turn contains a few levels of data, display it here in
various
> ways, no problem.
> </xsl:for-each>
>
> So you see what I want: just a specific range of records, based on integer
> parameters supplied in the xml document itself. Preferably I'd like to
avoid
> the method of iterating over all records, and simply not displaying those
> outside the range.
>
> I'm sure this is something brutally obvious to the skilled XSL user, but I
> couldn't seem to find a clear way to do in the documentation I looked at.
>
> Thanks!
>
> Clark
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.