Re: RDFa and Web Directions North 2009

On Feb 18, 2009, at 16:16, Julian Reschke wrote:

> Henri Sivonen wrote:
>> On Feb 18, 2009, at 15:21, Julian Reschke wrote:
>>> I still do not understand the nature of the problem.
>>>
>>> If you are in a namespace-aware environment (such as XOM, or  
>>> something using the XPath data model, such as XSLT), then use the  
>>> supplied XML namespace information.
>> While HTML5 parsing as defined today supplies namespace information  
>> for each element and attribute name, it doesn't supply xmlns:foo- 
>> based namespace mapping context for resolving prefixes in attribute  
>> content on the application layer.
>> Changing HTML5 parsing to supply this context would mean a parsing- 
>> level change for the benefit of RDFa. None of the features drafted  
>> HTML 5 so far need this.
>
> I was trying to understand your comments with respect to parsing  
> RDFa in a XOM instance.
>
> As far as I can tell, what you're saying is: if I plug my HTML5 SAX  
> parser into XOM, and feed it with HTML5 text/html containing xmlns:*  
> attributes, it's not going to work.
>
> This seems to be caused by the fact that XOM expects namespace  
> mapping events, and the parser is not supplying them.

Right. Alternatively, optimizing the SAX layer away from in between  
(what I've done) wouldn't let you get around this, either. This  
minimized demo throws nu.xom.IllegalNameException: Attribute objects  
are not used to represent  namespace declarations:

package nu.validator.htmlparser.test;

import nu.xom.Attribute;
import nu.xom.Element;

public class XomTest {
     public static void main(String[] args) {
         Element elt = new Element("html", "http://www.w3.org/1999/ 
xhtml");
         elt.addAttribute(new Attribute("xmlns:foo", "bar"));
     }
}

> So this is either a bug in the parser, or a bug in the way it is  
> integrated into XOM.

It is not a bug, because none of the conforming features of HTML5 (or  
HTML 4.01) depend on attributes than have a colon in their local name  
in text/html making it harmless to throw them away in non-browser apps.

RDFa is what makes it an issue. I posit the piece that is flawed is  
RDFa--not the way HTML parsing and infoset coercion is now defined.

> If your point was: there are cases where *today* existing components  
> plugged together cause RDFa not to work, then yes, that's probably  
> true. I'm pretty sure this is also true for many many other things  
> in the specs we're working on.


However, for many other things, there isn't a (bogus) claim that you  
only need to add five attributes or so and that's all. RDFa involves a  
countably infinite number of attributes that are of the most  
problematic kind.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 18 February 2009 14:41:52 UTC