Re: [xsl] select more than one value of element 'package' attribute 'name'

Subject: Re: [xsl] select more than one value of element 'package' attribute 'name'
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 1 Sep 2005 14:56:44 +0100
> 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
________________________________________________________________________

Current Thread