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]

RE: What is wrong with this key element?


> <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


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