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

On Mar 9, 2012, at 22:27 , Gregg Kellogg wrote:
> 
> 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.
> 

Gregg, I would not worry to much about that. I think most of the tests are fine because they are using this pre-head convention. If there are some files that would go wrong, we can handle that manually.


> 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.
> 

The issue is that this may not be enough. There may be several xmlns: attributes on one element, for different prefixes, and these should be combined into one prefix attribute. Again, I would do the simplest thing possible and curate the rest by hand.

My run through the HTML5 tests yesterday did reveal some issues, but I think they can be handled by hand. I would not worry too much.



>>>> 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.

I think we should keep the automatic XHTML1 and XHTML5 cases of setting the default namespace.

The only place this did bite us was the XML Literal test. I would simply remove it from the HTML5 branch.

Ivan 


> 
>> 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
>>> 
>>> 
>>> 
>>> 
>>> 
> 
> 


----
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 Saturday, 10 March 2012 10:49:13 UTC