Re: question on issue-110 (xml:lang vs. lang)

I have added the output now along with updating the test suite dashboard
for this new test.

The input is located here:
https://github.com/finnle/ITS-2.0-Testsuite/blob/master/its2.0/inputdata/languageinformation/html/languageinfo4html.html
The output is located here:
https://github.com/finnle/ITS-2.0-Testsuite/blob/master/its2.0/expected/languageinformation/html/languageinfo4htmloutput.txt

Let me know if this is okay,
Leroy


On 30 January 2013 13:41, Leroy Finn <finnle@tcd.ie> wrote:

> Everyone this test file now has been added here:
> https://github.com/finnle/ITS-2.0-Testsuite/blob/master/its2.0/inputdata/languageinformation/html/languageinfo4html.html .
> I will add the output soon. So issue-110 can be closed for Ankit.
>
> Cheers,
> Leroy
>
>
> On 29 January 2013 10:09, Leroy Finn <finnle@tcd.ie> wrote:
>
>> Okay I will add this test file today based on this discussion.
>>
>> Leroy
>>
>>
>> On 28 January 2013 21:32, Arle Lommel <arle.lommel@dfki.de> wrote:
>>
>>> Anything else would be tremendously unintuitive for most users and would
>>> create strange problems. So +1 to Yves and Shaun.
>>>
>>> Arle
>>>
>>> --
>>> *Arle Lommel*
>>> Berlin, Germany
>>> Skype: arle_lommel
>>> Phone (US): +1 707 709 8650
>>>
>>> *Sent from a mobile device. Please excuse any typos.*
>>>
>>> On Jan 28, 2013, at 21:21, Yves Savourel <ysavourel@enlaso.com> wrote:
>>>
>>> +1 on Shaun's comments.
>>> (especially "...xml:lang to take precedence over lang only when defined
>>> on the same node")
>>>
>>> -ys
>>>
>>>
>>> -----Original Message-----
>>> From: Shaun McCance [mailto:shaunm@gnome.org <shaunm@gnome.org>]
>>> Sent: Monday, January 28, 2013 12:28 PM
>>> To: Felix Sasaki
>>> Cc: Jirka Kosek; public-multilingualweb-lt@w3.org
>>> Subject: Re: question on issue-110 (xml:lang vs. lang)
>>>
>>> On Fri, 2013-01-25 at 12:17 +0100, Felix Sasaki wrote:
>>>
>>> Am 25.01.13 11:19, schrieb Jirka Kosek:
>>>
>>> On 25.1.2013 9:01, Felix Sasaki wrote:
>>>
>>>
>>>  we had discussed on Wednesday
>>>
>>> http://www.w3.org/2013/01/23-mlw-lt-irc#T11-36-22
>>>
>>> that xml:lang and lang take precedence over the BCP 47 value
>>>
>>> conveyed by a "langRule". One clarification question: should we
>>>
>>> state that this relation also includes inherited values? e.g.
>>>
>>>
>>> <html xml:lang="en" ...>...
>>>
>>> <its:langRule selector="//h:p" langPointer="@class"> ...
>>>
>>> <body lang="ja"> ...
>>>
>>> <p class="de">...
>>>
>>> </html>
>>>
>>>
>>> In this case the output of processing "langRule" would convey "en":
>>>
>>> xml:lang takes precedence over HTML lang. And xml:lang inherits to "p".
>>>
>>> My instinct says that inheritence shouldn't be applied here and for
>>>
>>> p element language should be selected using langRule.
>>>
>>>
>>> Fine by me - so the output in the test suite would be
>>>
>>>
>>> /html    lang="en"
>>>
>>> ...
>>>
>>> /html/body[1]    lang="ja"
>>>
>>> /html/body[1]/p[1]    lang="de"
>>>
>>>
>>> Now, if "p" contains a "span" element, what would the language be?
>>>
>>> Probably
>>>
>>>
>>> /html/body[1]/p[1]/span[1]    lang="de"
>>>
>>>
>>> I would say certainly lang="de". I would also expect xml:lang to take
>>> precedence over lang only when defined on the same node, so I would expect
>>> the language to be "ja" on body.
>>>
>>> getLang(node):
>>>  if node/@xml:lang: return node/@xml:lang
>>>  if node/@lang: return node/@lang
>>>  if node selected by a langRule: return value from rule
>>>   if node.parent: return getLang(node.parent)
>>>  else: return ""
>>>
>>> Seems to me that's the same algorithm we use for all other data
>>> categories, except we don't define our own local attribute, using xml:lang
>>> and lang instead.
>>>
>>> --
>>> Shaun
>>>
>>>
>>>
>>>
>>>
>>>
>>
>

Received on Wednesday, 30 January 2013 14:22:34 UTC