This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: What is wrong with this key element?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] What is wrong with this key element?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 6 Sep 2001 13:22:52 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> <xsl:key name="prodCat" match="@ProdCode"
> use="substring(@ProdCode,1,3)"/>
Either index the attributes, using
<xsl:key name="prodCat" match="@ProdCode" use="substring(.,1,3)"/>
or index their containing elements, using
<xsl:key name="prodCat" match="z" use="substring(@ProdCode,1,3)"/>
The use expression is evaluated with the matched node as context node; with
@ProdCode as the context node the expression @ProdCode gives you nothing.
I prefer to index the element nodes rather than their attribute nodes, but
both should work perfectly well.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list