This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Testing by counting or positional predicate
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Testing by counting or positional predicate
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 11 Jan 2001 11:51:03 +0000
- Organization: Jeni Tennison Consulting Ltd
- Reply-To: xsl-list at lists dot mulberrytech dot com
David C. and I have both brought this up recently, but hidden away in
the depths of other messages and I don't think anyone has commented on
it. So, I was wondering: which is more efficient for testing whether a
$subset node set is a subset of a $superset node set?
count($subset|$superset) = count($superset)
or:
not(($subset|$superset)[count($superset) + 1])
Does it make any difference if the $subset is just one node?
count($node|$node-set) = count($node-set)
or:
not(($node|$node-set)[count($node-set) + 1])
Does this extend to testing for identity or is the unioned set so
small that it doesn't make any odds?
count($node1|$node2) = 1
or:
not(($node1|$node2)[2])
Thanks,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list