Re: RDFa and Web Directions North 2009

Toby A Inkster wrote:
> There are theoretical objections to using xmlns:* attributes for RDFa in
> HTML. I understand them and mostly agree. It would be good to find a
> solution to these. But the practical problems are really minimal - once
> a stream of bytes has been turned into a DOM tree (and that is where the
> major differences between XHTML and HTML processing lie), the DOM tree
> can be processed as RDFa using the same algorithm for both XHTML and HTML.

That is exactly my experience, too.

The built-in parsing of xmlns:* in existing browsers may vary depending
on the mime type, but it's trivial to bypass this inconsistency if you
want to.

For example, the JavaScript RDFa library and bookmarklets [1] "just
work" on any DOM object, whatever the mime type. They have no trouble
pulling xmlns:* out of an HTML DOM.

Here's the proof: I took Henri's page, and added one <p> with RDFa that
uses the "dublincore" prefix that Henri defined, and another <p> with
the inlined RDFa bookmarklet so you can click the link and automatically
extract the triples live in your browser:

http://ben.adida.net/misc/rdfa/xmlns-dom.html

http://ben.adida.net/misc/rdfa/xmlns-dom.xhtml

Same bytes, different mime types, live parsing *in your browser*
producing the same RDF triples.

(Works on Safari and Firefox, not on IE because I haven't debugged my
JavaScript there lately.)

Like Toby, I understand and am sympathetic to the objections regarding
the use of xmlns:* in an HTML document. That said, it's interesting to
note that the problem is not one of technical feasibility. It's pretty
easy to make it work, actually.

-Ben

[1] http://www.w3.org/2006/07/SWD/RDFa/impl/js/

Received on Sunday, 15 February 2009 17:36:29 UTC