This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: applying templates to ancestor nodes without reprocessing context node


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]