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

RE: xpath selection problem

Subject: RE: xpath selection problem
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 18 Sep 2005 17:09:24 +0100
xpath sibling node
In 2.0 you can do

following-sibling::node[@hidden='0'] 
  except 
following-sibling::node[@hidden='1']/(.|following-sibling::node())

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

> -----Original Message-----
> From: Gabriel [mailto:gabriel.klappenbach@xxxxxxxxx] 
> Sent: 18 September 2005 16:17
> To: XSL-list
> Subject:  xpath selection problem
> 
> Hi.
> 
> On a document axis I have a list of nodes like this:
> 
> <node hidden=0>a</node>
> <node hidden=1>b</node>
> <node hidden=1>c</node>
> <node hidden=0>d</node>
> <node hidden=0>e</node>
> <node hidden=0>f</node>
> <node hidden=1>g</node>
> <node hidden=1>h</node>
> <node hidden=1>j</node>
> <node hidden=0>k</node>
> 
> 
> I want to select the group of consecutive nodes that have 
> hidden=1 after the
> context node, that will have hidden=0. So the context node 
> will iterate over
> the list of nodes that have hidden=0.
> 
> So if I were to output the contents of the selections, I 
> would first get
> "bc" and then "ghj"
> 
> 
> How can I express this in xpath without using recursion? Is 
> it possible
> doing this without calling a template that uses recursion? 
> That is, I would
> like to have an expression, something like
> following-sibling::*[@hidden=1], but with the addition that 
> it excludes the
> nodes in the other groups... 
> 
> /Gabriel

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.