Re: [xsl] A beautiful way to say: "give me the sequence after the first item"?

Subject: Re: [xsl] A beautiful way to say: "give me the sequence after the first item"?
From: "Alan Painter alan.painter@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Dec 2022 14:11:46 -0000
"Python" has nothing to do with "Beautiful".

On Fri, Dec 2, 2022 at 2:17 PM Dave Pawson dave.pawson@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Python has 'pythonic' methods / ways of writing.
>
> Has anyone come up with such a 'way' for XSLT?
>
> regards
>
> On Fri, 2 Dec 2022 at 13:11, Martin Honnen martin.honnen@xxxxxx
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> >
> > Am 12/2/2022 um 2:09 PM schrieb Roger L Costello costello@xxxxxxxxx:
> > > Hi Folks,
> > >
> > > I have a variable, $tokens, whose value is a sequence of items.
> > >
> > > I want to select all items after the first item. Here is one way to do
> it:
> > >
> > >       $tokens[position() gt 1]
> > >
> > > To my eyes, that is not beautiful code.
> > >
> > > Is there a beautiful (i.e., succinct) way to select all items after
> the first item?
> > >
> > There is
> >
> >    tail($tokens)
> >
> > in XPath 3 and
> >
> >    subsequence($tokens, 2)
> >
> > in XPath 2 and later, I think.
> >
> >
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.

Current Thread