This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4036 - lang() function: usage of hyphen "-"
Summary: lang() function: usage of hyphen "-"
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: Proposed Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ashok Malhotra
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-05 23:54 UTC by Felix Sasaki
Modified: 2007-02-25 23:36 UTC (History)
0 users

See Also:


Attachments

Description Felix Sasaki 2006-12-05 23:54:07 UTC
Hello,
http://www.w3.org/TR/2006/PR-xpath-functions-20061121/#func-lang needs two changes:
- editorial: "or if the string-value of the relevant testlang attribute contains a hyphen" should be "or if the string-value of the relevant xml:lang attribute contains a hyphen"
- non-editorial: The text
((Otherwise, 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.))
Looks like as if there could be only one hyphen in a language tag, but there can be several ones, e.g. "de-de-1997". $testlang as "de" matches both "de-de" and "de-de-1997". My proposal for a clarification: change the text to
((Otherwise, 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 xml:lang attribute contains on or more
hyphens, "-" (The character "-" is HYPHEN-MINUS, #x002D) such that a part
of the string-value from the first character until one of the hyphens is
equal to $testlang, using caseless matching.))
and add an example like <para xml:lang="de-de-1997"/> with several hyphens.

Felix
Comment 1 Ashok Malhotra 2006-12-14 18:54:37 UTC
On the 12/12/2006 telcon the WGs agreed to make the change recommended by Felix Sasaki.  They asked me to work with Michael Kay to work out the exact wording.  This was done on the (member-only) w3c-xsl-query mailing list.  The final wording agreed to with additional input from Michael Sperberg-McQueen and Jim Melton was:

"Otherwise, the function returns true if and only if, based on a caseless default match as specified in [The Unicode Standard], either
(1) $testlang is equal to the string-value of the relevant xml:lang attribute, or (2) $testlang is equal to some substring of the string-value of the relevant xml:lang attribute that starts at the start of the string-value and ends immediately before a hyphen (x2D)."
Comment 2 Felix Sasaki 2006-12-19 13:27:50 UTC
(In reply to comment #1)
> On the 12/12/2006 telcon the WGs agreed to make the change recommended by Felix
> Sasaki.  They asked me to work with Michael Kay to work out the exact wording. 
> This was done on the (member-only) w3c-xsl-query mailing list.  The final
> wording agreed to with additional input from Michael Sperberg-McQueen and Jim
> Melton was:
> 
> "Otherwise, the function returns true if and only if, based on a caseless
> default match as specified in [The Unicode Standard], either
> (1) $testlang is equal to the string-value of the relevant xml:lang attribute,
> or (2) $testlang is equal to some substring of the string-value of the relevant
> xml:lang attribute that starts at the start of the string-value and ends
> immediately before a hyphen (x2D)."
> 
Thank you very much, Ashok. I'm happy with your resolution. If you don't here from the i18n core WG anymore in the next three weeks (taking year end break into account), please regard the issue as closed.
Felix
Comment 3 Jim Melton 2007-02-25 23:36:16 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.