Re: Use of xml:base in rdf:HTML Datatype

Hi Gregg,

On 18 May 2012, at 23:25, Gregg Kellogg wrote:
> The editor's draft of RDF Concepts section on rdf:HTML Datatype [1] makes a specific callout about @lang needing to be included explicitly in the HTML literal. I presume that this reasoning also applies to any in-scope @xml:base (valid in XHTML5). So, if we consider the following:
> 
> <div property="rdf:value" datatype="rdf:HTML" xml:base="http://example.com/foo">
>  Interesting topic located <a href="bar">here</a>.
> </div>
> 
> The xml:base context in effect during processing would _not_ be retained in the literal. This is probably worth a similar note in the concepts document.

I've updated the note, it now reads:

[[
Any language annotation (lang="…") or XML namespaces (xmlns) desired in the HTML content must be included explicitly in the HTML literal. Relative URLs in attributes such as href do not have a well-defined base URL and are best avoided.
]]
http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-concepts/index.html#note-html-context

Is this better?

(As Gavin noted, xml:base is only allowed in XHTML5 document but not in HTML5 documents, therefore mentioning it explicitly would be confusing IMO. I don't think there's anything wrong as such with using @datatype="rdf:HTML" in XHTML5+RDFa — it basically means that the fragment has to be valid XHTML5, but will be treated as HTML5.)

Note that RDFa *could* define additional rules when parsing the contents of elements that have @datatype="rdf:HTML", such as absolutizing all URLs, or copying XML namespaces from the context onto the elements that need them, before generating the HTML literal. I don't have a particular opinion on whether that would be a good idea or not.

Best,
Richard

Received on Monday, 21 May 2012 10:50:12 UTC