[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 19:33:23 +0000
Re:  The identity transform and attributes
On 21/01/2008, David Carlisle <davidc@xxxxxxxxx> wrote:
> select="child::foo selects the parent of the current node,
>  match="child::foo" asks if that node is the child of anything.
> So unless you find it surprising that something can both have a parent
> and be a parent, I'm not sure what is surprising here?

Well when you put it like that...  :)

The bit I found non-intuitive (note the past tense now...) was that a
match pattern can be only attribute:: or child::  something that
doesn't get talked about much.

For example:

apply-templates select="parent::foo"

and

template match="foo"

That looks fine - I'm happy with that.  "foo" on its own looks right.
But when you realise that the match pattern is actually:

template match="child::foo"

...it gets a bit harder to understand why it's like that.  If you say
it as "foo that is a child of some node" then it makes slightly easier
to comprehend.  And then when you think about it, all elements are
children of either another element, or the root node (correct?) it
makes sense that child:: is the default.

I think.

:)



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