Click to See Complete Forum and Search --> : XML Declaration screwing up IE 6?


spoontacular
01-01-2003, 01:19 PM
When I use the XML declaration (<?xml version="1.0" encoding="utf-8"?>), IE messes up the box model. But as soon as I remove it, everything works.

Explain?

Stefan
01-01-2003, 01:30 PM
Originally posted by spoontacular
When I use the XML declaration (<?xml version="1.0" encoding="utf-8"?>), IE messes up the box model. But as soon as I remove it, everything works.

Explain?

Well know bug in IE/win 6 regarding it's doctype sniffing.
With the XML decl it incorrectly reverts to quiks/non standards mode as it fails to find the doctype.

Since the XML declaration is optional, just leave it out and IE 6 will go into standards compliant mode.

It's just yet one of those "how did the manage to botch thatone up in the final release" in IE.

Just remeber to add the charencoding metatag as well as the xhtml namespace in the <html> tag and you'll be fine :)

jeffmott
01-01-2003, 01:58 PM
Stefan
Since the XML declaration is optional

But only if you plan on using either UTF-8 or UTF-16. If you do omit, in your text editor you will have to save as and choose an encoding of one of the two encodings listed above.

Stefan
01-01-2003, 06:30 PM
Originally posted by jeffmott
But only if you plan on using either UTF-8 or UTF-16. If you do omit, in your text editor you will have to save as and choose an encoding of one of the two encodings listed above.

Unless of cource you have the option to set the charencoding in the HTTP header.