xsl-list
[Top] [All Lists]

RE: [xsl] Select the nearest of two preceding siblings

2007-07-20 02:21:15
Sorry if this is too simple, but I'm still a bit new at this. 
I need to compare the relative positions of two preceding 
siblings and grab the value of the nearest one.

I haven't managed to follow the detail of your requirement, but given two
nodes $A and $B you can select the one that comes last in document order
using

($A|$B)[last()]

or if you prefer

if ($A>>$B) then $A else $B

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>
--~--

<Prev in Thread] Current Thread [Next in Thread>