[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Select Deepest Node only in Iteration
I want to output the deepest node. What I get now is: //article/body[1]/section[6]/normallist[6]/item[1] //article/body[1]/section[6]/normallist[6] //article/body[1]/section[6] //article/body[1] //article I only want to first item. When I set position()=1, I always get the last item in the list, the root. When I set count(ancestor::node())=5, I do get the first item, but 5 is not always the deepest level, e.g. sometimes it is only 2. jz Michael Kay wrote: > Start with a change in mindset. position() does work. It just isn't the > answer to your particular requirement. > > Within a sorted for-each, position() returns the position of a node in the > sorted sequence. > > I don't know what the solution to your requirement is. You haven't told us > what you want to output, only that it's different to what position() > outputs. > > Michael Kay > http://www.saxonica.com/
|
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
|