Hi Phil,
> Two issues: first is that it is really comparing nodes not contents
Yes, that I understand. For example, here both element nodes contain
the same text node, but set:difference() still returns a node-set
<vlan><id id="100">99</id></vlan>:
$ cat foo.slax
version 1.2;
var $v1 := {
<vlan> {
<id id="99"> "99";
}
<vlan> {
<id id="100"> "99";
}
}
var $v2 := $v1/*[1];
main <top> {
<diff> {
copy-of set:difference($v1/*, $v2);
}
}
$ slaxproc -g -E foo.slax
<?xml version="1.0"?>
<top>
<diff>
<vlan>
<id id="100">99</id>
</vlan>
</diff>
</top>
$
What I quite don't understand is why set:difference() considers $v1/*
and $v2/* to be different:
$ cat foo.slax
version 1.2;
var $v1 := {
<vlan> {
<id> "99";
}
<vlan> {
<id> "99";
}
}
var $v2 := {
<vlan> {
<id> "99";
}
<vlan> {
<id> "99";
}
}
main <top> {
<diff> {
copy-of set:difference($v1/*, $v2/*);
}
}
$ slaxproc -g -E foo.slax
<?xml version="1.0"?>
<top>
<diff>
<vlan>
<id>99</id>
</vlan>
<vlan>
<id>99</id>
</vlan>
</diff>
</top>
$
When I execute "print $v1/*" and "print $v2/*" in the debugger, then
the output is identical.
thanks,
Martin
_______________________________________________
juniper-nsp mailing list [email protected]
https://puck.nether.net/mailman/listinfo/juniper-nsp