Re: Subtle namespace difference with RDFa+HTML5 for XML Literals...

On Mar 9, 2012, at 10:34 AM, Niklas Lindström wrote:

> Good timing; I hit this problem just last night.
> 
> On Fri, Mar 9, 2012 at 6:11 PM, Ivan Herman <ivan@w3.org> wrote:
>> [snip]
>> 
>> On Mar 9, 2012, at 17:52 , Gregg Kellogg wrote:
>>> 
>>> Have I mentioned that I hate XMLLiterals?
>> 
>> Welcome in the club:-)
> 
> I have a thing or two to say about the DOM API calls needed to create them.. ;)
> 
>>> 
>>>> We can create a separate test for HTML5+RDFa, doing the same but with a different SPARQL. On the other hand, in view of the controversial nature of the xmlns usage in HTML5, I would probably be o.k. to remove it from the HTML5 branch altogether.
>>> 
>>> This is really where an HTMLLiteral would make sense, and use that for HTML5 instead of XMLLiteral.
>> 
>> Correct.
>> 
>>> As I understand it, polyglot markup, where xmlns would be appropriate, would only make sense for XHTML5, not HTML5. I'd suggest we remove HTML5 (and HTML4, I suppose) from anything using xml:lang or xmlns (with the exception of the stated use of xml:lang as a namespace-less attribute, which I'd rather see go away from HTML5+RDFa).
>> 
>> See my previous mail. This may remove way too much, we should be careful about this. For the time being I think removing the XML Literal version from HTML{4,5} makes sense.
> 
> Sounds good to me.

So, this is my thought: for HTML4 and HTML5 tests, I'll translate @xmlns= and @xmlns:foo= into @prefix on the <html> element. I won't for any XHTML, XML or SVG.

The way the .txt files are written is that everything before a <head is considered to be attributes on the root element (<html> for *HTML tests). This means that we can't have tests that don't begin with a <head>, which limits the ability to test files that don't begin with <html>, which could be problematic for some HTML5 tests we might want to do.

What I suggest is the following: Instead of looking for <head>, we simply extract all lines that are of the form /^\s*xml.*$/. If any are found, the rest of the document is wrapped in <html></html> (or other appropriate root element) with either @xmlns* or @prefix added. Otherwise, the .txt file is used without modification.

>>> If work is ever done on HTMLLiteral (RDF WG?), then we could include this for HTML5, and it would probably be appropriate for XHTML varieties as well).
>>> 
>>>> I am not sure about XHTML5. Does the namespace appears for that one? If so, it is fine to have it for that one...
>>> 
>>> Being XML, I believe that xmlns is appropriate).
>>> 
>> 
>> Does XHTML5 use the same namespace URI?
> 
> I believe that a root element in XHTML5 has to have
> @xmlns="http://www.w3.org/1999/xhtml". See e.g. [1]. (I'm not sure
> where this is officially defined, but it seems implied in [2].) AFAIK
> there is no implicit #FIXED @xmlns in XHTML5 though, as there is in
> XHTML 1, via the doctype DTD. If I understand things correctly, the
> HTML5 doctype doesn't denote any DTD, so an XML parser can't add it.
> Therefore, we must probably have this explicit @xmlns in all XHTML5
> tests.

The suite automtically adds the @xmlns for XHTML1 and XHTML5 when it creates a root element. As I preposed before, it wouldn't do this unless if found the namespace definitions as I specified above.

> Best regards,
> Niklas
> 
> [1]: http://blog.whatwg.org/xhtml5-in-a-nutshell
> [2]: http://www.w3.org/TR/html-polyglot/
> 
> 
>> ivan
>> 
>>> Gregg
>>> 
>>>> Ivan
>>>> 
>>>> 
>>>> 
>>>> ----
>>>> Ivan Herman, W3C Semantic Web Activity Lead
>>>> Home: http://www.w3.org/People/Ivan/
>>>> mobile: +31-641044153
>>>> FOAF: http://www.ivan-herman.net/foaf.rdf
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
>> ----
>> Ivan Herman, W3C Semantic Web Activity Lead
>> Home: http://www.w3.org/People/Ivan/
>> mobile: +31-641044153
>> FOAF: http://www.ivan-herman.net/foaf.rdf
>> 
>> 
>> 
>> 
>> 

Received on Friday, 9 March 2012 21:28:38 UTC