Re: Not grokking keys...

Subject: Re: Not grokking keys...
From: James Clark <jjc@xxxxxxxxxx>
Date: Thu, 22 Apr 1999 19:54:57 +0700
Guy_Murphy@xxxxxxxxxx wrote:

> Thanks for addressing this....
> 
> I'm almost there I think. The problem I face is it still looks like
> defining classes to me, I'm sure I'm only following you half-way.
> 
> <xsl:key name="titles" match="div" use="title"/>
> 
> The match="div" gets a collection together of div elements,

Right you've got a table of all the div elements.

> and we can now
> refer to that collection as titles as defined name="titles".
>
> What I'm still not grasping is use="title"

The table is indexed by the title children: I can retrieve a div from
the table using the value of the title child of the div element.

The table of div elements indexed by their titles is named "titles".
 
> And with keyref('titles', .) what's the second param got to do with
> anything?

The second param says that you use the value of the current element to
look up the div element that you are trying to find. If you instead had

<divref ref="Expressions"/>

you would instead use

  keyref('titles', @ref)

James


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


Current Thread