Click to See Complete Forum and Search --> : how do I make a 'reunion' between 2 lists


iuli
09-16-2003, 10:01 AM
If I have 2 lists with different nodes, but some of them have the same name, how do I make a third list which contains all the nodes from the first 2 lists but does not have 2 elements with the same name?

EX:

<SWP>
<P0>
...........
</P0>
<P1>
...........
</P1>
</SWP>


<APP>
<P0>
...........
</P0>
<P1>
...........
</P1>
<P3>
...........
</P3>
</APP>

So, in this case if I have list1 with the nodes from SWP and list2 with the nodes from APP, how do I make list 3 which contains only the nodes P0, P1 and P3?

paps
09-16-2003, 05:58 PM
You could try using "//P0" "//P1" this should help u pick up all the P0 and P1 elements, and then for-each through all of them....forming ur third list.....

iuli
09-17-2003, 08:14 AM
Ok, but I don't know how to create a variable that contains a list of nodes (node-set) through a for-each.

<xsl:variable name"test">
<xsl:for-each select"initial_list">
<xsl:value-of select="current()"/>
</xsl:for-each>
</xsl:variable>

I want that variable 'test' to contain a list of nodes.

Is it possible to do something like this? (to change the value of a variable during a for-each cycle?)