Christoph Pichlmann

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromChristoph Pichlmann
ToMe
SubjectSuggestion for XML/XHTML prologue/conformance tag and IE(using conditional comments)
Date19 July 2005 14:10
Hi!

First off, great site. Great design, even better content.

In the chapter about XHTML you mention that the XML conformance tag throws IE
into quirks mode.
Recently that topic came up during a discussion on MozillaZine, where the
following "solution" has been found:
(Though to be honest, I would assume someone else had that idea before, but
this is the first occurence I know of.)

[code]
<!--[if IE]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<![endif]-->

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
[/code]

As far as non-IE(win) Browsers are concerned, there is only a comment before
the XML declaration - which should be valid.
IE, however, doesn't get anything before the DocType - thus staying/entering
in Standards mode.
Also, IE gets the Doctype twice - but that doesn't seem to hurt it.

The problem with that is, of course, that it'll only work with Win-IE, as
Mac-IE doesn't know conditional comments.
Besides, it doesn´t solve the much more pressing problem of MIME-Type.

Regards,

Christoph
FromMe
ToChristoph Pichlmann
SubjectRe: Suggestion for XML/XHTML prologue/conformance tag and IE(using conditional comments)
Date25 July 2005 15:02
Christoph,

> In the chapter about XHTML you mention that the XML conformance tag
> throws IE into quirks mode.
> Recently that topic came up during a discussion on MozillaZine, where the
> following "solution" has been found:
>
> [code]
> <!-- snip -->
> <?xml version="1.0" encoding="utf-8"?>

Sadly, this is not valid. Although the human readable spec allows it, the
spec grammar does not (document ::= prolog element Misc* - Char*
RestrictedChar Char*), so the SGML comment is not allowed before the prolog
- only the byte order mark is allowed there

As for encoding, that would have been possible, using the meta tag, but
since the comment trick is not allowed, we cannot use any of this :(


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.