[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
Re: Getting previous node in nodeset
Subject: Re: Getting previous node in nodeset|
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 22 Apr 2011 08:24:10 +0100
On 22/04/2011 02:28, Steve Fogel wrote:
Hi, all...nodesets are an xpath1 data type not in xpath2, which is relevant to
your question as being sets their items are not ordered.
Xpath2 datatype is sequence which is an ordered list, I think you want
This assumes that it is node that $mynode occurs exactly once, otherwise
you'd need to add some error checking and fallback.
Would appreciate a suggestion:
- I have a node set in the variable $nodelist
- and I have a single node in the variable $mynode
- and the node in $mynode is a member of $nodelist
then in XSLT 2.0, how do I set a variable to contain the node that is previous to $mynode in $nodelist?
For simplicity and a quick answer, you can assume that all nodes in $nodelist are siblings, but in reality, $nodelist contains<topicref>s from a DITA map, so the previous node could be a sibling, a parent, or the child of the previous sibling.
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