[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Wath is the opposite of the union operator?

Subject: Re: Wath is the opposite of the union operator?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 22 Sep 2005 16:44:09 +0100
opposite of union
> I'm curious about what's going on behind the scenes (that is, in the 
> processor) that makes this expensive.

without having looked behind the scenes, on the face of it count(.|B) is
a very expensive operation (if "B" selects a large set of noders) as you
have to take the set union | which invloves removing duplicates etc,
then count the thing, which means that you need to fully evaluate all of
B.

All you actually need to know is is . in the set returned by B which you
can ask  in xpath 2 using the is operator (so it would be a lot more
efficient even if except wasn't added as a primitive.
With such a test you can stop and return true as soon as you have found
the current node, just as B[1] typically only causes a processor to
evaluate one node, even though the formal semantics of the expression
are that B is fully evaluated, sorted into document order, and then the
first item is taken.

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.