[thelist] Confused - how does all this fit together ?

Peter-Paul Koch pp.koch at gmail.com
Sat Dec 4 03:19:24 CST 2004


> I read that an XHTML document served with MIME
> text/xml does not have any of the objects/properties
> defined in the DOM HTML while if served with MIME
> application/xhtml+xml it does. Is that true? Maybe I
> am mixing things up here - even though the DOCTYPE
> would still be the same the difference in MIME type
> would then determine which parts of the DOM apply.

No, sorry, I've never heard of this before. Don't attach too much
importance to either mime type or doctype. When all's said and done
they're not *that* important.

> Does that mean that in your ImportXML() example at
> 
> http://www.quirksmode.org/dom/importxml.html
> 
> the line
> 
> xmlDoc = document.implementation.createDocument("",
> "", null);
> 
> overwrites the window.document object? 

Definitely not. As you can see in the test page the original document
remains in place.

> Now that was a surprise to me. So I extended my test
> and found the following:
> 
> If I try to load the file 'test.xhtml' in Mozilla
> using Ctrl-O (from the filesystem = no MIME type) I
> get the error. 

I do the same and I don't get the error.

> If I put 'test.xhtml' on the server and
> serve it with MIME application/xhtml+xml I get the
> correct result! In both cases Mozilla determines the
> Render Mode: Standards compliance mode.
> IE6 on the other hand shows the correct result from
> the filesystem (Ctrl-O) but cannot handle the proper
> MIME type.

You're comparing apples and pears. Please forget about the mime types.
They don't have ANYthing to do with DOM scripting.

> 1. Is this Mozilla behaviour a bug?

If you see a zero, yes, but I don't see it.
 
> 2. If the object tree of a document depends not only
> on the document code but also on the MIME type 

It doesn't.

-- 
-------------------------------------------------------------------
ppk, freelance web developer

NEW: Bug Report system:
Report bugs yourself, or comment on previously 
reported ones.
http://www.quirksmode.org/bugreports/
------------------------------------------------------------------


More information about the thelist mailing list