Closed Bug 263450 Opened 20 years ago Closed 5 months ago

nsIRDFRemoteDataSource.Refresh doesn't load files with other files extensions as rdf

Categories

(Core Graveyard :: RDF, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mbaumann, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910

I have tried load an File as nsIRDFRemoteDataSource.
var remote = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);

    try {
      remote.Init(src); // throws an exception if URL already in use
    }
    catch(err) {
      // loading already
      load = false;
    }

    if (load) {
      try {
        remote.Refresh((flags & JSLIB_RDF_FLAG_SYNC) ? true: false);
      }
      catch(err) {
        dump(err);
        return;
      }
    }

if src an uri like : file:///d:/test.rdf I get a remote Objcet with the URI
:file:///d:/test.rdf and lodded =true

if src an URI like file:///d:/test.sed (the file contains the same as test.rdf)
the methode remote.Refresh throw an err ( but no err.Message !!)
and the remote.loaded is still false !!

is it ab Bug or is there a other reason ?


Reproducible: Always
Steps to Reproduce:
1. see Details
2.
3.



Expected Results:  
load all files with an RDF inside regardless there file extension.
Sounds like a MIME type issue. I wonder if we trigger the sniffer for file://
URLs.
Could you try to load the .sed file in the browser itself? For me, this gives an
xml pretty printer on linux.
here is the content of *.sed file:
<?xml version="1.0" ?><RDF:RDF xmlns:EBMTVC="http://www.ebmt.de/ebmt/mapping#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><RDF:Seq
about="urn:ebmt:data"></RDF:Seq></RDF:RDF>

The Browser can open this file.
Note: the encondig is not defined ! Is there the Problem ?

Matthias
This is definitely a MIME type issue.  The parser doesn't get an XML type, and
then tries to use CNavDTD, which expects an HTML content sink, which we don't
give it (we give it an XML content sink).  So the DTD throws an error, which
propagates back.

I suppose we could force stuff to be parsed as XML, but I think we _do_ want to
throw errors on things like 404 pages and the like...  Note that an XHTML 404
page with the XHTML MIME type will get parsed as RDF with the current setup,
though.  ;)
This should get better once we load stuff right. I.e., we should probably throw
a rich error message like "wrong mime type", hinting an xml mime type 
nevertheless.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.