Subject: Re: [xsl] alternative to repeatedly walking the ancestor axis in 1.0 From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 04 Aug 2008 10:27:31 -0400 |
2008/8/2 Michael Kay <mike@xxxxxxxxxxxx>:
>> Out of interest, does xml:lang annotate the input tree, or does the
>> lang() function walk the ancestor axis behind the scenes? Or
>> is it all implementation dependent?
>
> It's implementation-dependent, of course.
>
> Saxon walks the ancestor axis when you use the lang() function. I think it's
> used too rarely to be worth optimizing.
So (for Saxon anyway) doing:
test="lang('foo', .)"
is pretty much the same as:
test="ancestor-or-self::*/@xml:lang = 'foo'"
except that the lang() function should return true if the lang tested is a subset of that declared in the attribute.
So given an existing proprietary solution that walks the ancestor axis a lot, you're not going to gain anything by switching to xml:lang...
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] alternative to repeatedly, Andrew Welch | Thread | Re: [xsl] alternative to repeatedly, Andrew Welch |
Re: [xsl] alternative to repeatedly, Dimitre Novatchev | Date | Re: [xsl] alternative to repeatedly, Andrew Welch |
Month |