This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Merging and Quines


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]