Closed
Bug 194176
Opened 23 years ago
Closed 5 years ago
document.load should parse as XML regardless of mime type
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: karoline.kirmse, Assigned: hjtoi-bugzilla)
References
()
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
I import with the following script a xml or rdf or xhtml file.
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.onload = init;
xmlDoc.load("eg-00.xhtml");
function init(){
var xmlSeri=new XMLSerializer();
alert(xmlSeri.serializeToString(xmlDoc));}
The Problem is the following:
do I call a xml-file its working fine (really good)
do I call a rdf-file or xhtml-file (by calling the website local on my PC) it is
loaded perfectly
but (now the Problem)
do I call the same site from the internet the script returns an empty string!
Reproducible: Always
Steps to Reproduce:
Comment 1•23 years ago
|
||
can you attach a testcase ?
can you post Talkback ID for this crash "mozilla/bin/components/talkback.exe" ?
Severity: normal → critical
Keywords: crash,
stackwanted
| Reporter | ||
Comment 2•23 years ago
|
||
try that one as another testcase, you can also try it with IE
http://ipsi.fhg.de/~kirmse/Testarea/testcase/tester.html
Comment 3•23 years ago
|
||
removing crash keyw as it doesn't actually crash Moz.
Severity: critical → normal
Keywords: crash,
stackwanted
Comment 4•23 years ago
|
||
document.load -- to heikki
I bet the problem is that the XHTML and RDF document just don't have an XML MIME
type (both are text/plain).
Assignee: jst → heikki
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 5•23 years ago
|
||
Yes, the problem is that the server returns text/plain for files with .xhtml and
.rdf suffix, and therefore Mozilla will not even try to parse them as XML. So,
you can fix your samples by making sure the server sends the correct XML mime type.
However, I think Mozilla might actually be against the DOM Level 3 spec (still
draft) here. Load & Save defines here:
http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DOMBuilder
(see "supported-mediatypes-only") that the default is: "Don't check the media
type, accept any type of data." I read this as: parse as XML regardless of the
media type. Someone correct me if I am wrong.
Comment 6•23 years ago
|
||
No, you're right. That's what the LS spec calls for.
| Assignee | ||
Comment 7•23 years ago
|
||
Let's see if I can fix it for 1.4alpha.
Summary: importing a rdf or xhtml document via document.implementation.createDocument crashed → document.load should parse as XML regardless of mime type
Target Milestone: --- → mozilla1.4alpha
Comment 8•23 years ago
|
||
It'd be great to be able to tell the syncloader to override the mimetype.
Documents loaded with the XSLT document() function need to ignore the mimetype too.
Comment 9•23 years ago
|
||
Um, hasn't there been some controversy in the TAG over whether specs
should be allowed to do things like this (instruct overriding of HTTP
Content-Type)?
| Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.4alpha → mozilla1.4beta
| Assignee | ||
Comment 10•22 years ago
|
||
*** Bug 137240 has been marked as a duplicate of this bug. ***
| Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.4beta → ---
Comment 11•5 years ago
|
||
document.load() was removed.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
| Comment hidden (Intermittent Failures Robot) |
You need to log in
before you can comment on or make changes to this bug.
Description
•