- From: Michael Kay <mhk@mhk.me.uk>
- Date: Tue, 12 Dec 2006 10:50:49 -0000
- To: <ziaul.haq@patni.com>, <public-qt-comments@w3.org>
The reference to a "sublanguage" occurs in the summary of the fn:lang
function description, which explains the overall intended purpose. The
detailed mechanics of the function are described a few paragraphs below, as
follows:
"...the function returns true if and only if the string-value of the
relevant xml:lang attribute is equal to $testlang based on a caseless
default match as specified in section 3.13 of [The Unicode Standard], or if
the string-value of the relevant testlang attribute contains a hyphen, "-"
(The character "-" is HYPHEN-MINUS, #x002D) such that the part of the
string-value preceding that hyphen is equal to $testlang, using caseless
matching."
So with xml:lang="en-us-ca" in scope, lang("en"), lang("en-us"), and
lang("en-us-ca") should all return true, as will expressions such as
lang("en-US").
(I don't know if there was a good reason for it to use the string-value of
the attribute rather than the typed-value, but it does. Using the
string-value means you can't rely on leading and trailing spaces being
trimmed.)
(personal response)
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: public-qt-comments-request@w3.org
> [mailto:public-qt-comments-request@w3.org] On Behalf Of zia
> Sent: 05 December 2006 13:41
> To: public-qt-comments@w3.org
> Subject: fn:lang("en-us")
>
> Hi,
>
> What should be the output of my expression fn:lang("en-us")
> if xml:lang="en-us-ca" is specified for my context node.
> Should "en-us-ca" be considered as the sub language of
> "en-us" or not ?
>
> Thanks and Regards,
> Zia
>
>
>
> http://www.patni.com
> World-Wide Partnerships. World-Class Solutions.
> _____________________________________________________________________
>
> This e-mail message may contain proprietary, confidential or
> legally privileged information for the sole use of the person
> or entity to whom this message was originally addressed. Any
> review, e-transmission dissemination or other use of or
> taking of any action in reliance upon this information by
> persons or entities other than the intended recipient is
> prohibited. If you have received this e-mail in error kindly
> delete this e-mail from your records. If it appears that
> this mail has been forwarded to you without proper authority,
> please notify us immediately at netadmin@patni.com and delete
> this mail.
> _____________________________________________________________________
>
Received on Tuesday, 12 December 2006 10:51:16 UTC