This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: applying templates to ancestor nodes without reprocessing context node
- From: Wendell Piez <wapiez at mulberrytech dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 10 Apr 2002 14:03:17 -0400
- Subject: Re: [xsl] applying templates to ancestor nodes without reprocessing context node
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@mulberrytech.com
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