[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
On 5/24/06, Mark Williams <mark@xxxxxxxxxxxxxxxxx> wrote:
n is the number of signatures
template: print a sig block, if n - 1 != 0 call the template again with n - 1
As long as you don't start with a negative number, the function will terminate.
Jon Gorman
Re: [xsl] xsl:for or xsl:repeat
Subject: Re: [xsl] xsl:for or xsl:repeat From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx> Date: Wed, 24 May 2006 11:02:46 -0500 |
On 5/24/06, Mark Williams <mark@xxxxxxxxxxxxxxxxx> wrote:
Thanks guys.
I would have thought there'd be some really noddy way to do this. Sometimes xsl is so damned frustrating and so incomprehensible to your bog standard programmer. Ah well.
I've decided that as there is only ever a max possible no of clients of 4, I'll just do it by if statements.
I'm guessing from your message your'e using XSLT 1 since you're not trying the XSLT 2.0 way. I'd encourage you (unless some performance reasons indicate otherwise) to take a look at my sample again. It's a little convoluted, but it's really isn't that bad. You just essentially are doing the recursive function:
n is the number of signatures
template: print a sig block, if n - 1 != 0 call the template again with n - 1
n won't ever reach 0. You could move the if block around and do it so there's a base case, I was just a bit lazy.
As long as you don't start with a negative number, the function will terminate.
I just get bad feelings about systems that are arbitrarly restricted. Seems so....limiting ;). Like web forms that don't let me get my full title in because the assume everyone's title can fit in 10 characters or something. One of the perks of a document system like this is that we can move away from arbitrary restrictions. But sometimes it's necessary.
Jon Gorman
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl:for or xsl:repeat, Mark Williams | Thread | Re: [xsl] xsl:for or xsl:repeat, Wendell Piez |
[xsl] <xsl:number/> question, Culler, Jeff S. | Date | Re: [xsl] Writing array elements ba, Wendell Piez |
Month |