RE: [xsl] key() question?

Subject: RE: [xsl] key() question?
From: "Américo Albuquerque \(E-mail\)" <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Wed, 10 Jul 2002 15:39:40 +0100
Sorry for my newbie question but, given this xml
<doc>
 <something>
  <pattern level="1"/>
  <anotherthing>
   <pattern level="2"/>
  </anotherthing>
  ....
 </something>
 <pattern level="1"/>
</doc>

 and given this xsl

...
<xsl:template match="doc">
 <xsl:apply-templates/>
</xsl:template>

<xsl:template match="pattern">
 ...
</xsl:template>

<xsl:template match="//pattern">
 ...
</xsl:template>


doesn't the match="pattern" gets only the level=1" patterns???
and match="//patterns" get's all of them??

thanks in advance

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of David
Carlisle
Sent: Wednesday, July 10, 2002 2:04 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] key() question?



> a template match is done in a given context,
no

> the key (as I understand it) does the full traversal of the whole
> document, as if template match="//pattern"

yes exactly, but

 template match="//pattern"

is the same (except for default priority) as
 template match="pattern"

ie such a template would match the same nodes as got indexed by a key
with the same match pattern.

David



_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread