Thomas Winwood

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromThomas Winwood
ToMe
SubjectXML prolog on XHTML pages - IE breaking?
Date7 April 2005 07:38
Just thought I'd let you know (regarding the broken IE box model) that the
XML prolog which you lament breaks IE compatibility is not required by the
standard and it is recommended that it be left out specifically for the
reason you mourned it.

Reference this forum thread [url] which recommends removing the XML prolog
- the standard warns that the only charsets then supported are UTF-8 and
UTF-16, but this is easily rectified with the same META element which is
telling the browser to load the page as application/xhtml+xml or text/html.
Additionally this [url] mentions it.
FromMe
ToThomas Winwood
SubjectRe: XML prolog on XHTML pages - IE breaking?
Date8 April 2005 12:07
Thomas,

> the XML prolog which you lament breaks IE compatibility is not
> required

In the case of my document, it is required (more details later).

> it is recommended that it be left out specifically
> for the reason you mourned it.

Yep, because IE sucks, we have to leave it out .... which is exactly what I
was saying in my article.

I will quote from the spec (the part referred to is informative, not a
requirement)
http://www.w3.org/TR/xhtml1/#C_1

> some user agents interpret the XML declaration to mean that the
> document is unrecognized XML rather than HTML, and therefore may not
> render the document as expected.

Indeed, this is true, but that is what I was trying to say. IE is the main
user agent that screws it up (although it screws it up in a different way
to the way they are saying).

> For compatibility with these types of legacy browsers, you may want to
> avoid using processing instructions and XML declarations.

IE being the legacy, still the problem.

> Remember, however, that when the XML declaration is not included in a
> document, the document can only use the default character encodings
> UTF-8 or UTF-16.

And I use 8859-1 so I have to include it.

So I still stand by what I said. IE is causing a problem, because I am
supposed to include the prolog, and when I do, it misinterprets the
document type, and gets the CSS wrong as a result.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromThomas Winwood
ToMe
SubjectRe: XML prolog on XHTML pages - IE breaking?
Date8 April 2005 13:16
Why are you using 8859-1 anyway? All documents I create use UTF-8 by
standard. I'm sure there's little to nothing in 8859-1 which isn't
replicated in UTF-8.

Additionally, from RFC 2119: 'SHOULD: This word, or the adjective
'RECOMMENDED', mean that there may exist valid reasons in particular
circumstances to ignore a particular item, but the full implications must
be understood and carefully weighed before choosing a different course.'

I'd think cross-browser compatibility was a suitable circumstance to ignore
the XML prolog, especially considering XHTML provides the META tag to pass
HTTP headers.
FromMe
ToThomas Winwood
SubjectRe: XML prolog on XHTML pages - IE breaking?
Date8 April 2005 13:38
> Why are you using 8859-1 anyway?

Because I am a western european, and that is our default. I could use UTF-8,
but since all of the hosting services I have used serve pages as 8859-1,
and all the text editors I use default to 8859-1, I don't see any reason
not to use it. The fact is that a 'current' browser should cope with the
prolog, because that is where you specify the encoding. If a browser cannot
understand it, or changes unrelated behaviour because of it, then the
browser has a problem. The vendor _should_ fix it. For now at least,
Microsoft choose not to.

> I'd think cross-browser compatibility was a suitable circumstance to
> ignore the XML prolog, especially considering XHTML provides the META tag
> to pass HTTP headers.

I agree, if I wanted to produce identical responses, I would be forced not
to include it, even though it prevents me from specifying the encoding on
the page. The fact sill remains that it is a problem in IE. It should not
cause problems. It does cause problems. It should be fixed.

And note that according to the same document:
'In order to portably present documents with specific character encodings,
the best approach is to ensure that the web server provides the correct
headers. If this is not possible, a document that wants to set its
character encoding explicitly must include both the XML declaration an
encoding declaration and a meta http-equiv statement'

So I would still have to use the xml prolog, not just the meta tag. Like it
or not, some pages _need_ that prolog. And IE will screw up the rendering
mode when that happens. I know about the compatibility implications, and I
do agree that in order to be compatible with IE, you have to remove the
prolog. But that doesn't change the fact that IE is screwing up its
rendering as a result of me including something perfectly valid, and often
necessary. And that is what the article is about.

[Importantly, some hosts do not allow you to change the content-type header
- for example, my old host only used 8859-1 and did not allow me to change
it. So to use XHTML, I would have to use the prolog to comply with the
standard.]
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.