Re: Question about Microdata to RDF Note and lang attribute

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 Tuesday, 11 September 2012 17:43:13 UTC