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

Re: A beautiful way to say: "give me the sequence afte

Subject: Re: A beautiful way to say: "give me the sequence after the first item"?
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Dec 2022 13:17:19 -0000
Re:  A beautiful way to say: "give me the sequence afte
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

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.