Subject:Indexing by group? Author:James Durning Date:12 Nov 2004 02:10 PM
I've got a structure like
<links>
<linktype1>
<link parent="1" target="3"/>
<link parent="1" target="4"/>
<link parent="1" target="5"/>
<link parent="2" target="6"/>
<link parent="2" target="7"/>
</linktype1>
<linktype2>
<link parent="3" target="8"/>
<link parent="1" target="9"/>
</linktype2>
...
</links>
The final simplified structure looks like:
<links>
<link parent="1" order="1" target="3"/>
<link parent="1" order="2" target="4"/>
<link parent="1" order="3" target="5"/>
<link parent="2" order="1" target="6"/>
<link parent="2" order="2" target="7"/>
<link parent="3" order="1" target="8"/>
<link parent="1" order="1" target="9"/>
...
<links>
However, I am missing the last link (parent=1, target=9)
I need other to be the index based on the parent. what I have now uses the Muenchian method and then uses the position() to get the order. The actual 'links' contain much more information, and involve copying complex nodes..
-----
<xsl:for-each select="*\link[count(. | key('linkbyparent', @parent)[1]) = 1]">
seems to be the problem line.. anyone know a different method, or one that doesn't use key?