This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Merging and Quines
- To: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Subject: Re: Merging and Quines
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Mon, 14 Aug 2000 19:00:36 +0100
- Cc: xsl-list at mulberrytech dot com
- Reply-To: xsl-list at mulberrytech dot com
Oliver,
>By the way: thinking about keys ...
>Is it true that defining a key will always index into the *whole* document?
>So if I want to compare two arbitrary node sets (given in two variables)
>this is no use case for keys, is it?
Keys index into any nodes that they match in the document that the current
node is in. You could define a key that only indexed into a portion of the
document by making the match attribute only match that portion of the
document, but you can't dynamically change the portion of the document that
they index into.
I haven't tested this and it may or may not be relevant to what you were
after, but it might be possible to do something like:
key('keyname', 'keyvalue')[generate-id() = generate-id($node-set1)]
i.e. return the nodes that the key returns that are in $node-set1, or:
count(key('keyname', 'keyvalue') | $node-set1) !=
count(key('keyname', 'keyvalue')) + count($node-set1)
returning true if there any nodes returned by the key that are also in
$node-set1.
Can you give a more concrete example of what you're after?
Cheers,
Jeni
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list