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

Re: applying templates to ancestor nodes without repro

Subject: Re: applying templates to ancestor nodes without reprocessing context node
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 10 Apr 2002 14:03:17 -0400
xslt select nodes without ancestor
Jarom,

If I understand you correctly, the error is in your XPath:

At 01:13 PM 4/10/2002, you wrote:
<xsl:apply-templates select="node()[ancestor::l]" mode="noApps"/>

This doesn't select ancestors. Fully expanded, it is equivalent to


child::node()[ancestor::l]

or "all child nodes that have an ancestor l". (Absent an axis specifier, XPath assumes the child axis. The predicate acts to filter the node set: so your XPath does not read "nodes that are ancestor l" but rather "[child] nodes that *have* ancestor l" (or to be really persnickety, "[child] nodes for whom the expression 'ancestor::l' is true, i.e. for whom, acting as the context node, the set of nodes ancestor::l is not empty").

I think what you want is merely select="ancestor::l", which selects all l ancestors (each app should have only one).

Good luck--
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.