Re: [xsl] How to select an attribute on the current node or its anchestor

Subject: Re: [xsl] 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
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