Re: RDFa and Web Directions North 2009

Henri Sivonen wrote:
> On Feb 16, 2009, at 14:29, Ivan Herman wrote:
> 
>> Henri Sivonen wrote:
>>>>
>>>> * a list of current implementations
>>>> http://rdfa.info/rdfa-implementations/
>>> Quoting that page:
>>>> Python
>>>>
>>>>    * RDFa Distiller
>>>>      Author: Ivan Herman
>>>>      http://www.w3.org/2007/08/pyRdfa/
>>>
>>> This implementation uses a tree representation that leaks qnames to the
>>> application layer even in XML. Thus, it doesn't demonstrate the problems
>>> that apply to SAX and XOM.
>>>
>>> (Aside: The way the parser is chosen is non-conforming per HTML 5.)
>>>
>>
>> Aside: do you have a pointer to a conforming HTML 5 parser that can also
>> be used with Python?
> 
> html5lib itself is fine.

Ah, o.k., I misunderstood what you said. Sorry.

> 
> However, (by inspection of source) pyRdfa seems to parse input as XML
> regardless of HTTP Content-Type and falls back to html5lib if the XML
> parser raises an exception.
> 
> The HTML 5-compliant way is to use the XML parser for
> application/xhtml+xml (without html5lib fallback) and html5lib for
> text/html.
> 

Indeed. However, the core of the Python package is oblivious to the
content type and considers the source code (whether it is xml or not)
only. The accept header becomes relevant only if the package is used via
HTTP, which is not necessarily the case (I use the same code off line on
my machine as a command line tool, for example). Ie, adapting that to
any other strategies v.a.v. the accept header is a minor and easy job to
do, and hence, I believe, a secondary issue in this discussion for now.

Thanks

Ivan

-- 

Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Monday, 16 February 2009 13:16:47 UTC