[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] things about grouping


Subject: Re: [xsl] things about grouping
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxx>
Date: Thu, 29 Nov 2012 08:37:30 +0000

On Thu, Nov 29, 2012 at 8:08 AM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
>> Oh goodie - I can slip this in without having to start a new thread.
>>
>> Why do I have to write
>>
>> for $i in (1 to n)  return "$1"
>
> You probably meant return
>
> for $i in (1 to n)  return $i
>
> (unless you really wanted to return the string "$1" n times)
>

yes I do want to return the string "$1" n times.

>>
>> instead of
>>
>> (1 to n)/"$1!
>
> You can now in 3.0 using the ! operator:
>
> (1 to 5) ! concat('A', .)
>
> returns A1 A2 A3 etc
>

Mea culpa for the typo (I use Dvorak and " and ! are proximately
colocated). I want to know why I cannot write  (1 to n)/"$1" to give
me the string "$1" n times in XSLT 2.0.

 I actually used this  (or rather the version of it that I was forced
to write) in some code I've just written.


Current Thread
Keywords