[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
"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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|