xsl-list
[Top] [All Lists]

Re: [xsl] Select Deepest Node only in Iteration

2007-07-13 04:52:07
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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--