xsl-list
[Top] [All Lists]

Re: Applying templates for unique children

2003-08-04 13:40:24



   Why don't I just use the Muenchian method again? Because there are
  <definition> elements that have the same value under a different
  root/sequence so the first element in the key may not be the same as
  the one in the current node, e.g.:

The trick is to generate a key expression that distinguishes what you
want distinguished.
In this case that's a combination of sequence and definition
so for your second level key do
<xsl:key name="x" match="definition" use="concat(../sequence,'@',.)"/>
and use a similar concat in your key() lookup. This assumes that '@'
is a safe separator (ie doesn't appear in your definitions) if it is not
suitable there must be some unicode character to hand that isn't used in
your data.

David

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



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