Re: Variables and inherited attributes

Subject: Re: Variables and inherited attributes
From: Jeni Tennison <Jeni.Tennison@xxxxxxxxxxxxxxxx>
Date: Wed, 21 Jun 2000 16:46:03 +0100
David Carlisle wrote:
>Unlike // which potentially causes a search of the whole document
>I'd have thought that for most document types the number of ancestor
>nodes is typically quite small, and so looking back up the ancestor axis
>to find the relevant xml:lang should be quite efficient?

Everyone knows this, but just to make it explicit - there's rarely any need
to go through this if you're talking about xml:lang because the XPath
function lang() already checks the ancestor nodes to find the value of the
nearest xml:lang attribute [1], and will presumably be more efficient than
either passing parameters or searching ancestors.

The more troublesome 'official' attributes are xml:space [2] and xml:base
[3].  Are there any others?



                                 ^^^^^^^ nice ID!

P.S. Personally, I'd lean towards searching ancestors because of the
headaches involved in making sure parameters get passed to where you want
them (and because I prefer stand-alone templates anyway).  However, if I
had a deeply nested structure, and were applying templates on each child
element within that structure anyway, then passing parameters might be more

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email

 XSL-List info and archive:

Current Thread