Ticket #729 (closed defect: fixed)
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")
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
Note: See TracTickets for help on using tickets.Download in other formats: