Ticket #729 (closed defect: fixed)

Opened 3 years ago

Last modified 18 months ago

Trouble with dojo.io.bind and XML

Reported by: anonymous Owned by: jburke
Priority: normal Milestone:
Component: Core Version: 0.3
Severity: normal Keywords:
Cc:

Description

dojo.io.bind({

url: urlXML, useCache: true, preventCache: true, mimetype: "text/xml", handler: function(type, data, e) {

if(type == "load") {

var articles = data.getElementsByTagName("indexElt");

}

}

});

and a piece of my XML : <?xml version="1.0" encoding="UTF-8"?> <indexRoot> <indexElt mot="Hérité"> <lien url="Ont1.html" /> <lien url="Ont2.html" /> <lien url="Ont3.html" /> </indexElt> <indexElt mot="New"> <lien url="Agent0.html" /> <lien url="Agent1.html" /> <lien url="Domain1.html" /> </indexElt> </indexRoot> With FireFox?, this code tells me there are 2 articles in XML IE says zéro. in BrowserIO, if I change

if((kwArgs.mimetype == "application/xml") (kwArgs.mimetype == "text/xml")){

ret = http.responseXML;

if(!ret typeof ret == "string") {

ret = dojo.dom.createDocumentFromText(http.responseText);

}

} to

if((kwArgs.mimetype == "application/xml") (kwArgs.mimetype == "text/xml")){

ret = dojo.dom.createDocumentFromText(http.responseText);

} I got the correct answer.

Change History

Changed 3 years ago by jburke

  • owner changed from anonymous to jburke
  • status changed from new to assigned
  • milestone set to 0.3.1

Changed 3 years ago by jburke

  • status changed from assigned to closed
  • resolution set to fixed

Fix in r4197. I was able to reproduce this error in MSIE when loading tests/io/test_BrowserIO.frag.html from the local disk. It seems like MSIE does not treat the file as real XML file. I put in a fix to allow correct parsing for files served from local disk (response header of Content-Type is blank). This seems to work. If you are seeing this error from a page served from a web server, be sure that the file is being served with the right content type in the HTTP response headers (should be text/xml or application/xml).

Changed 18 months ago by anonymous

  • milestone deleted

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.