RE: Not grokking keys...

Subject: RE: Not grokking keys...
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 22 Apr 1999 16:22:43 +0100
Many thanks for the explanation. Makes sense now. Let's hope something
similar finds its way into the next version of the spec!

> It's the "use" attribute not the "name" attributes that tells you what
> to use to find elements.  The "name" attribute tells you what xsl:key
> definitions to use for a particular keyref() or key() function call.
> 
> Suppose you have
> 
> <Employee>
> <SSN>6789</SSN>
> <Name>Michael Kay</Name>
> <ManagedBy>1234</ManagedBy>
> </Employee>
> 
> <Employee>
> <SSN>1234</SSN>
> <Name>John Smith</Name>
> </Employee>
> 
> then you might do:
> 
> <xsl:key match="Employee|Contractor" name="people" use="SSN"/>
> 
> <xsl:template match="ManagedBy">
>  <xsl:value-of select="keyref('people',.)/Name"/>
> </xsl:template>
> 
> James
> 
> 
>  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