xsl-list
[Top] [All Lists]

Re: [xsl] The identity transform and attributes

2008-01-21 10:35:51


 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:


yes.

the real mind bender is:

apply-templates select="parent::foo"

being matched by:

template match="child::foo"

Is that clear is anyones mind?

There's no direct relationship between the form of the XPath expression
used in a select attribute and the form of an XSLT pattern used to match
the nodes.

a node might be selected by 
select="foo" or 
select="parent::foo" or 
select="key('wibble','wobble')
it really makes no difference. The criterion for deciding whether a node
is matched by a particular pattern only involves the node and its
location in the current document, the expression used to select the node
is simply not consulted during the matching process.

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? 

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--