This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: key() question?


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@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of David
Carlisle
Sent: Wednesday, July 10, 2002 2:04 PM
To: xsl-list@lists.mulberrytech.com
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]