Hi,
I have two lists of attributes ($attr1, $attr2). I want to make a list ($attr3) that will be everything found in $attr1
and NOT in $attr2.
example:
doc1.xml:
Code:
<attr1 a=5 b=6 c=7/>
<attr2 c=7 b=6/>
Running this code:
Code:
<xsl:variable name="attr1" select="attr1\@*"/>
<xsl:variable name="attr2" select="attr2\@*"/>
Returns this:
$attr1[0] = 'a' 5
$attr1[1] = 'b' 6
$attr1[2] = 'c' 7
$attr2[0] = 'c' 7 // Notice that its not ordered
$attr2[1] = 'b' 6
What I would like to get in attr3 is this:
$attr3[0] = 'a' 5 <- in attr1 and NOT in attr2
I looked around, and found some formula, that didnt work
$attr1[count(.|$attr2)=count($attr2)]..
Code:
<xsl:variable name="attr3" select="$attr1[count(.|$attr2)=count($attr2)]"/>
attr3 came out empty..
If you have anything that might help me, please let me know, iam quite lost..
Thanks,
Shlomi