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

Re: The identity transform and attributes

Subject: Re: The identity transform and attributes
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 21 Jan 2008 17:00:41 +0000
Re:  The identity transform and attributes
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:

match="foo"

you really have:

match="child::foo"

...to distinguish between foo being an attribute or element?  The same
logic applies to node() in that:

match="node()"

is really

match="child::node()"

so to get attributes as well you need to explicitly say that:

match="attribute::node()|child::node()"

...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:

apply-templates select="parent::foo"

being matched by:

template match="child::foo"

Is that clear is anyones mind?  If so, please share :)


thanks
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.