[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: alternative to repeatedly walking the ancestor axi

Subject: Re: alternative to repeatedly walking the ancestor axis in 1.0
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 4 Aug 2008 11:00:07 +0100
Re:  alternative to repeatedly walking the ancestor axi
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...


> 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.

Sounds similar to xlink...

I guess a good example to show what you're talking about is XHTML -
where you always see:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

@lang is the application layer, @xml:lang is the XML layer.  I think
it's defined twice to cover both bases.

Reading around a bit it seems @lang has been dropped completely from
XHTML 1.1 Strict in favour of xml:lang... so somebody somewhere thinks
it really should be defined in the XML layer...


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.