> On 19 Jul 2015, at 16:12, Eliot Kimber <[email protected]> wrote: > > That seems to easy Ken. > > In terms of processing optimization, is there any reason to prefer one > formulation over the other (meaning, is it possible to predict how XPath > processors will be able to optimize this type of expression)? >
No, it’s not really possible to predict. Both are amenable to optimization, but there’s a law of diminishing returns in what it’s worth attempting. Saxon will do both pretty much as written. Saxon did at one time attempt to rewrite a/b/c/X except a/b/c/Y as a/b/c/(X except Y) but I found it was unsound, which taught me a lesson. (I forget the actual case that demonstrates this.) I still find it very hard to know how to prove which rewrites are sound and which aren’t. Michael Kay Saxonica _______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
