xsl-list
[Top] [All Lists]

Re: [xsl] What's wrong with my ancestor syntax?

2007-03-26 15:59:35

        <xsl:for-each select="*/menuItem[ancestor-or-self::pageID =
$pageID]"> 

that selects menuItem's that have an ancestor, or are a pageID element
with the supplied value, but clearly a menuItem is never a pageID and
looking at your input I don't think it ever as pageID has ancestor.

I think you want to know if the current eleemnt or ancestor has a pageID
child, so that's

        <xsl:for-each select="*/menuItem[ancestor-or-self::menuItem/pageID =
$pageID]"> 

or just coming down rather than going down and up each time:

        <xsl:for-each select="*/menuItem[pageID = 
$pageID]/descendant-or-self::menuItem"> 

David


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