RE: [xsl] thoroughly confused about node() matching

Subject: RE: [xsl] thoroughly confused about node() matching
From: David N Bertoni/Cambridge/IBM <david_n_bertoni@xxxxxxxxxx>
Date: Mon, 3 Mar 2003 16:55:02 -0800

> As a pattern, match="node()" is short for match="child::node()", which
> matches any node that is a child of anything - which means elements,
> text nodes, comments, and PIs, but not root nodes, attributes or
> namespaces.
> What's probably confusing you is that as a node-test, node() matches any
> node. So if it's used with a different axis, e.g.
> match="attribute::node()" or match="ancestor::node()", it will match
> other node types than these.

Actually, the only axis specifiers allowed in patterns are "child,"
"attribute," and "@," so "ancestor::node()" is not a valid pattern.

Doesn't this imply a template can never match a namespace node?  If so,
then the select attribute of xsl:apply-templates can select namespace
nodes, but no template will ever match them.

My feeling is this was done intentionally, but I'm not sure.  Does anyone
know the history?


 XSL-List info and archive:

Current Thread