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

RE: select/except based on position()

Subject: RE: select/except based on position()
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 3 Oct 2009 11:06:33 +0100
RE:  select/except based on position()
(1 to count(/items/item))[. != $num]

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

> -----Original Message-----
> From: jesper.tverskov@xxxxxxxxx 
> [mailto:jesper.tverskov@xxxxxxxxx] On Behalf Of Jesper Tverskov
> Sent: 03 October 2009 10:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  select/except based on position()
> 
> I would like to generate a sequence of numbers. @no contains a number.
> $num the item position not to be included.
> 
> The following works:
> select="/items/item/@no except /items/item[$num]/@no"
> 
> But I would like to base the selection on position().
> The following first step of the new solution is also working:
> select="/items/item[position() != $num]/@no"
> 
> Now, I would like to drop @no. I only made it up because I 
> couldn't solve my problem without it. @no contains the 
> position of the item!
> 
> The following is the closed I have been able to get so far, 
> but it doesn't work:
> select="/items/item[position() != $num]/position()"
> 
> This is what I want: For an item, return the item positions 
> of the other items.
> 
> Any hints for how to change the select statement?
> 
> Cheers,
> Jesper

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.