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

RE: xslt performance issue position() function used in

Subject: RE: xslt performance issue position() function used in predicate very slow
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 26 Aug 2006 20:45:39 +0100
xslt performance kay
> > It's redundant in all those cases. It's not redundant in:
> 
> > ./(a,b)     (:because it causes sorting into document order:)
> 
>   I don't understand this one.  Could you please explain it a 
> little bit further?  It'd be perfect if you have a reference 
> within the CRs.
> 

XPath section 3.2 describes the effect of the "/" operator as follows:

Each operation E1/E2 is evaluated as follows: Expression E1 is evaluated,
and if the result is not a (possibly empty) sequence of nodes, a type error
is raised [err:XPTY0019]. Each node resulting from the evaluation of E1 then
serves in turn to provide an inner focus for an evaluation of E2, as
described in 2.1.2 Dynamic Context. The sequences resulting from all the
evaluations of E2 are combined as follows:

   1. If every evaluation of E2 returns a (possibly empty) sequence of
nodes, these sequences are combined, and duplicate nodes are eliminated
based on node identity. The resulting node sequence is returned in document
order.

So whereas the sequence (a,b) is not necessarily in document order, the
sequence ./(a,b) is, by virtue of the "/" operator. Equally you can force
sorting of a sequence S into document order by writing S/., or S|(). Or in
this particular case, of course, (a|b)

Michael Kay
http://www.saxonica.com/

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.