[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: What's wrong with my ancestor syntax?

Subject: Re: What's wrong with my ancestor syntax?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 26 Mar 2007 23:59:20 +0100
Re:  What's wrong with my ancestor syntax?
	<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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.