Groups | Blog | Home
all groups > dotnet xml > may 2004 >

dotnet xml : xpath wildcard: ANY offspring match


darrel
5/26/2004 10:40:24 AM
I'm still struggling with xpath syntax.

I'm creating a menu via XSLT that checks to see if any given node has a
descendant somewhere down the chain that is the 'current active page' and,
if so, then it should display itself.

I've been using this for my syntax:

<xsl:if test="page/linkID | page/page/linkID | page/page/page/linkID |
page/page/page/page/linkID = $activeLink">

this is obviously way more verbose that I want to be.

is there syntax for this that doesn't require all of the 'ors'?

Something like if text="any linkID of ANY descandant = $activeLInk"

-Darrel

darrel
5/26/2004 11:35:04 AM
[quoted text, click to view]

I finally found a great cheat sheet for XPATH:

http://www.deepx.com/resources/quickref/XPath-1.0.pdf

which contained my answer:

descendant-or-self::linkID = $activeLink

-Darrel

AddThis Social Bookmark Button