[Home] [By Thread] [By Date] [Recent Entries]
Peter,
This is a de-duplicating problem. As in the Muenchian technique for grouping, de-duplication can be achieved using keys. For example, if you have a key declaration: <xsl:key name="WXY" match="X" use="concat(generate-id(ancestor::W),'#',@Y)"/> Then, given any W as context node, <xsl:for-each select=".//X
[generate-id() =
generate-id(key('WXY',concat(generate-id(ancestor::W),'#',@Y))[1])]">will iterate only over the first X elements that appear inside the W with a given @Y value. This logic can be uncompressed if you need it to be clearer. (But note: untested, and David has already one-upped me once today. :-) The solution is elusive because the problem usually appears in a different form. Cheers, Wendell At 11:45 AM 6/22/2006, you wrote: I am sure this is a hoary old one, but I could not work out the right runes to achieve it, nor the right keywords to search for to find an answer
|

Cart



