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

Re: Cheaper to prepend or append an item to a sequence

Subject: Re: Cheaper to prepend or append an item to a sequence?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 22 Feb 2011 20:44:44 +0100
Re:  Cheaper to prepend or append an item to a sequence
PQQP5QP;P0P2,

Actually, it _is_ dependent on the current node. //@id gets all @id nodes in the document. The next "[..]" means "filter these nodes by the following expression". That expression is a node-test: "not(ancestor::meta)", which is applied to the _current_ node (the current @id-node).

That doesn't mean that a processor cannot optimize that, but in this case that might proof futile: no single element can contain multiple attributes with the same name. Hence the processor will have to test the predicate for each and every found id-attribute.

In short: no, it cannot be calculated only once.

Kind regards,
Abel Braaksm


On 22-2-2011 20:26, PQQP5QP;P0P2 P!P5P4P>P2 wrote:
@id = //@id except (@id, //meta//@id) - yep... good idea

but i think that even //@id[not(ancestor::meta)] should be calculated
only once since it not depend from current node - is not it? is
optimizer capable to recognize context dependant from context
independant XPath fragments inside predicate and calculate independant
fragments only once instead calculating it every time for each node?

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.