Subject: Re: [xsl] The identity transform and attributes From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 21 Jan 2008 15:16:43 -0500 |
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.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] The identity transform an, Andrew Welch | Thread | Re: [xsl] The identity transform an, David Carlisle |
Re: [xsl] The identity transform an, Wendell Piez | Date | Re: [xsl] extension to insert XML i, Steven Ericsson-Zeni |
Month |