Unique merging of node-sets 2003-02-28 - By Karsten Theis
Hi,
I'm looking for a way to merge to node-sets into one, but I don't want to have duplicate elements.
The following XPATH works, but it's slow and should be replaced by two xsl:key statements:
Working XPATH (It is possible, that $id1 = $id2):
<xsl:variable name="all_nodes" select = "//elem[@(protected)=$id1 or @(protected)=$id2]"/>
xsl:key statement:
<xsl:key name="element_index" match="*" use="@(protected)"/> <xsl:variable name="node1" select = "key('element_index', $id1)"/> <xsl:variable name="node2" select = "key('element_index', $id2)"/>
How can I merge "node1" and "node2" into a node-set? And what happens, if $id1 = $id2 ?
Ciao, Karsten
|
|