I was wondering where I can find some information how IE8 actually handles xml header… for example how is handling <?xml version="1.0" encoding="utf-8"?> different to <?xml version="1.0"?>. Or how is handling processing node different in ie and other browsers.
One other questions would be how FF handles those header. Is it any different? If it is, what are the differences exactly.
/Marko
It isn’t. The default encoding is
utf-8, so including or omitting that part of the declaration makes no difference.In any case when you are talking about browsers handling XHTML pages served as
text/htmlMIME type, the encoding in the XML Declaration is ignored; only the<meta>tag (and, of course, the real HTTP header it is based on) has any effect. There is only a difference in browsers if you are serving them different types (eg.text/htmlto IE andapplication/xhtml+xmlto the others). Don’t do that.Including the XML Declaration at all in an XHTML-as-HTML document causes IE6 to render the document in Quirks Mode, but that’s fixed in later versions.
You should not include an XML Declaration in XHTML-as-HTML, and it’s IMO of highly doubtful utility even in native XML, as the default version and encoding are almost always the values you want.