Re: Question about Microdata to RDF Note and lang attribute

Gregg, thanks for clarifying the intention of the microdata to RDF
spec ([1]). OK, so let me clarify the terms.

Re: HTML5 spec [2],

(A) I believe "the language of a node" is described here in the sense
of CSS3 :lang() selector which "uses the UAs knowledge of the
document's semantics to perform the comparison" [3].

(B) On the other hand, "The lang IDL attribute" is, IMHO, the lang
attribute value of the element itself, in the sense of CSS3 ‘|=’
operator which "only performs a comparison against a given attribute
on the element" [3]. DOM lang property follows this, too.

An HTML comsumer needs both (A) and (B), and these are not the same.

For most spec readers, I think, "set from the lang IDL attribute of
the property element" (in [1]) means B, i.e. "set from DOM lang
property value of the element". (BTW, original microdata spec
described it as "set from the language of the element" [4], which is
closer to what you say [1]'s intention).

Thank you for taking time to talk with me.
cheers,

[1] http://www.w3.org/TR/microdata-rdf/
[2] http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-lang-and-xml:lang-attributes
[3] http://www.w3.org/TR/css3-selectors/#lang-pseudo
[4] http://www.w3.org/TR/2011/WD-microdata-20110525/#rdf


2012/9/12 Gregg Kellogg <gregg@greggkellogg.net>:
> On Sep 11, 2012, at 1:52 AM, KANZAKI Masahide <mkanzaki@gmail.com> wrote:
>
>> Gregg, thanks for the quick response.
>>
>> 2012/9/11 Gregg Kellogg <gregg@greggkellogg.net>:
>>> The HTML IDL attribute for .lang includes the @lang context of the element,
>>> including its ancestors. From [2]:
>>>
>>> [[[
>>> To determine the language of a node, user agents must look at the nearest
>>> ancestor element (including the element itself if the node is an element)
>>> that has a lang attribute in the XML namespace set or is an HTML element and
>>> has a lang in no namespace attribute set. That attribute specifies the
>>> language of the node (regardless of its value).
>>> ]]]
>>
>> I wonder "the language of a node" is different from IDL attribute,
>> which is separately described at the end of section 3.2.3.3 as
>>
>> [[
>> The lang IDL attribute must reflect the lang content attribute in no namespace.
>> ]]
>>
>> AFAIK, all modern browsers return "" for the DOM lang value of <cite>
>> and <span> elements in microdata to RDF example. Isn't this "the lang
>> IDL attribute of the property element" ?
>
> We'll, my interpretation is that the lang content attribute of an element is what's described in the first quote:
>
> [[[... That attribute specifies the language of the node ]]], so to determine the language attribute of a node, consider the nearest ancestor element having an @lang attribute. The IDL .lang method then reflects this value. This is certainly consistent with the intention of setting @lang on an ancestor, and having it remain in-scope for descendant nodes until another @lang attribute is introduced. There's also symmetry with xml:base (in the XHTML variety), which is used to influence the lookup of relative URLs.
>
> In any case, the microdata-rdf spec makes it clear through examples what the intended behavior is, and the test suite will ultimately provide tests that help validate this.
>
> Thanks for the note. If you think some clarification is needed in the normative text, we're prepping an update release for additionalType anyway; however, I think that if there's any mis-interpretation, it's in the HTML spec.
>
> Gregg
>
>> cheers,


-- 
@prefix : <http://www.kanzaki.com/ns/sig#> . <> :from [:name
"KANZAKI Masahide"; :nick "masaka"; :email "mkanzaki@gmail.com"].

Received on Wednesday, 12 September 2012 03:30:06 UTC