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?

Cheers,

Jeni

[1] http://www.w3.org/TR/xpath#function-lang
[2] http://www.w3.org/TR/REC-xml#sec-white-space
[3] http://www.w3.org/TR/xmlbase#IDw1Aq1
                                 ^^^^^^^ 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
favourable.

Dr Jeni Tennison
Epistemics Ltd, Strelley Hall, Nottingham, NG8 6PE
Telephone 0115 9061301 ? Fax 0115 9061304 ? Email
jeni.tennison@xxxxxxxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread