xsl-list
[Top] [All Lists]

Using key with XPath and use value?

2003-01-15 10:14:10
If <xsl:key> is defined at the top-level of a document (i.e., globally), can
you get to values based on the XPath as well as the key value? 

For example, I'm attempting to output subheads based on the attribute value
of an element. I have element <b> which can have several element <d>
descendants. <d> has a 'pub' attribute which is used to determine the
subhead I need and all matching pub attributes are grouped for output under
the appropriate subhead. <b>, however, can occur any number of times in a
document. If I define a key as such:

<xsl:key name="pubsBySubhead" match="d" use="@pub"/>

can I get to the values for only the specific <b> for which I'm processing?
I seem to be getting everything indexed in the key for each matching @pub,
which is basically all the matches thoughout the whole document.

Any help appreciated!


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



<Prev in Thread] Current Thread [Next in Thread>