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

Re: How to select an attribute on the current node or

Subject: Re: How to select an attribute on the current node or its anchestor
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 15 Apr 2011 17:13:08 +0100
Re:  How to select an attribute on the current node or
On 15/04/2011 16:38, Philipp Kursawe wrote:
Hello Michael,

ancestor-or-self::*[@data][1]/@data


Or if you prefer, (ancestor-or-self::*/@data)[last()]
Which one is faster, if any?


Depends on your processor. You'll have to measure it and see. My guess for Saxon is the version using [last()], but I might be wrong. The difference is unlikely to be noticeable unless your tree is very deep.


Michael Kay
Saxonica

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.