RE: [xsl] alternative to repeatedly walking the ancestor axis in 1.0

Subject: RE: [xsl] alternative to repeatedly walking the ancestor axis in 1.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 2 Aug 2008 09:33:15 +0100
> 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.

You also asked:

>why does xml:lang exist

And I think the answer is that the I18N lobby is sufficiently powerful in
W3C that they overrode the architectural arguments for putting this kind of
thing in a different layer; XML should be completely neutral as to the
meaning of element and attribute names, and such things should be defined
only in application-specific vocabularies. 

(But it's true, of course, that xml:lang is permitted only where the DTD
says it is permitted, so in that sense it's not part of core XML, it's just
available for inclusion in an application vocabulary if you choose to
include it.)

Michael Kay
http://www.saxonica.com/

Current Thread