[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|