xsl-list
[Top] [All Lists]

RE: If Current Node Is Ancestor!

2005-04-12 00:55:49
I am trying to test whether a current node is an ancestor of 
a menu node
with a dept attribute equal to $depth. I appear to be 
struggling with this
conceptually and would appreciate any help!!

<xsl:if test="//menu[(_at_)dept != $dept]/ancestor::menu ">

You just want

test=".//menu[(_at_)dept != $dept]"

Note the "." to force selection to start at the current node: //menu starts
from the root of the tree. The final /ancestor::menu doesn't appear to
relate to anything in the requirement as stated, so I left it out.

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>