What is the difference between 'matching' and 'selecting'?
Consider
<xsl:template match="a/b">
and
<xsl:value-of select="a/b"/>
in the first you may use a match pattern in the second you may use an
XPath expression, a/b is legal in both but
<xsl:value-of select="ancestor::x"/>
<xsl:value-of select="1+2"/>
<xsl:value-of select="sum(item)"/>
are all XPath expressions (so legal in select="" that are not XSLT
patterns (so not legal in match="").
The way they are used is different: if you evaluate a/b as an expression
then starting at the current node you first evaluate a (returning the
set of a children) then for each of those you evaluate b (returning the
set of b grandchildren.
match patterns are not directly evaluated in the same way. If (for any
current node) you do
<xsl:apply-templates select="something">
and a node _selected_ by "something" _matches_ "a/b" then the template
will be executed.
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
--~------------------------------------------------------------------
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>
--~--