W3C home > Mailing lists > Public > www-archive@w3.org > December 2001

llyn.py Content Sniffing Problem Patch

From: Sean B. Palmer <sean@mysterylights.com>
Date: Fri, 7 Dec 2001 17:10:33 -0000
Message-ID: <014001c17f42$17a14aa0$14b90150@localhost>
To: "Tim Berners-Lee" <timbl@w3.org>, "Dan Connolly" <connolly@w3.org>
Cc: <www-archive+n3bugs@w3.org>
Hi,

When I process an N3 file with "log:semantics" in a rule, llyn.py will
incorrectly guess that the file that I want it to parse is an XML RDF
file, even if it's clearly Notation3. I managed to isolate the
problem, which was that it searched for the string "xmlns" in the
file, and I was using a namespace of DanBri's, with "xmlns.com" in the
URI :-)

To fix it I simply changed:-

[[[
            if buffer.find('xmlns') >=0:
]]]

to:-

[[[
            if buffer.find('rdf:RDF') >=0:

]]]

and it worked.

--
Kindest Regards,
Sean B. Palmer
@prefix : <http://webns.net/roughterms/> .
:Sean :hasHomepage <http://purl.org/net/sbp/> .
Received on Friday, 7 December 2001 12:14:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:15 GMT