[thelist] ?xml &c. declaration

Chris Kaminski chris at setmajer.com
Sun Jun 16 14:12:01 CDT 2002


Thus spake Jonathon Isaac Swiderski:

> Can anyone on thelist give me a good reason for using the xml declaration, (ie
> <?xml version="1.0" encoding="iso-8859-1" ?>) in a page?  It tosses IE6 into
> bass-ackward mode,

That would be the main reason I use it: when IE6 is getting caught in
filters for IE4-5 but doesn't need the 'fixes' for those browsers.

> as tom just mentioned it occasionally gets displayed as text or forces older
> browsers to thinking it's not HTML & trying to download the page.

I'm wondering if those glitches are really due to the <?xml?> declaration or
if perhaps there's a server configuration issue going on, as I've not
experienced that problem. Then again, the browser I heard this in connection
with was Mac IE4.5, which I haven't seen in our logs in over 12 months.
YMMV.

> I'd like to leave this line in, as it *is* part of the recommendation for
> XHTML (or seems to be; see http://www.w3.org/TR/xhtml1/#docconf under the
> "example of a minimal XHTML document."), but I can't think of any reason I
> should leave it in.

To declare the character set? You could do that with a <meta> tag as well,
but that can cause a double-load in NN4.0x (both platforms) if your server
is either not sending a charset declaration as an HTTP header or is sending
one different from the one you're using in your <meta> tag. NN4.0x will load
the page once with the server-specified charset, then again with the charset
in the <meta> tag. The nasty thing is that it forgets some of your CSS on
the 2nd load.

Probably the best approach to charset issues is to just configure the server
to send the proper charset in an HTTP header and leave it out of the
document altogether. AFAIK, that's a perfectly valid approach, though the
W3C validator does issue a 'warning' of sorts.


chris.kaminski == ( design | code | analysis )

------------------------------------------------------------
    I used to be an idealist, but then I got
    mugged by reality.
    -------------------------------------------<< unknown >>




More information about the thelist mailing list