[XSL-LIST Mailing List Archive Home]
Re: [xsl] The identity transform and attributes
Subject: Re: [xsl] The identity transform and attributes|
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 21 Jan 2008 17:00:41 +0000
On 21/01/2008, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
> > David Carlisle wrote:
> > attribute::node() and self::node() both select attribute nodes.
> > node() on its own is short for child::node() which does not select
> > attribute nodes because there are never any attributes in the child
> > axis, it is teh child axis that does not include attributes, not the
> > node() node test.
> That's a great insight.
+1 to that.
I guess this explains why the allowed axes in match patterns are child
and attribute. So when you have:
you really have:
...to distinguish between foo being an attribute or element? The same
logic applies to node() in that:
so to get attributes as well you need to explicitly say that:
...so the only way for match="node()" to match all node types
including attributes would be if node() wasn't automatically converted
to child::node(), but some other all encompassing axis.
Assuming this is correct so far, the real mind bender is:
being matched by:
Is that clear is anyones mind? If so, please share :)