Click here to get back home

how to switch on Standards-compliant mode for IE6 when using the trick w3 provided for serving xhtml as application/xml to IE

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
how to switch on Standards-compliant mode for IE6 when using the trick w3 provided for serving xhtml as application/xml to IE Zhang Weiwu 01-22-2007
Get Chitika Premium
Posted by Zhang Weiwu on January 22, 2007, 9:23 pm
Please log in for more thread options


http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml
webpage to IE as application/xml

I used that trick and now every one of my xhtml webpage have following
first 4 starting lines:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="curseIE.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

The second line is used to tell Internet Explorer to treat this page as
html, as a workaroudn suggested by w3.org (curseIE.xsl is a file in the
same directory).

however now the page is rendered in BackCompat mode. I don't understand.
Because a lot of layout is already designed with CSS box model in mind, I
need IE to render it in the Standards-compliant mode ("Standards-compliant
mode" is the terminology used by MSDN I just copy it over). As stated in
this MSDN article:
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/doctype.asp
The standard compliant mode is switched on if DOCTYPE is XHTML (which is
true for my webpages)

I also read that some people suggest not to put <?xml ...?> as the first
line because that makes IE switch off Standards-compliant mode. Well, so I
removed <?xml ... ?>, result? Standards-compliant mode is still switched
off, tested by using
javascript:alert(document.compatMode);

So is it possible at all to use w3's trick to server xhtml to IE and at
the same time make the page render in Standards-compliant mode?

Thanks a lot in advance!

Posted by Gus Richter on January 22, 2007, 10:24 pm
Please log in for more thread options


Zhang Weiwu wrote:
> http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml
> webpage to IE as application/xml
>
> I used that trick and now every one of my xhtml webpage have following
> first 4 starting lines:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="curseIE.xsl"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>
> So is it possible at all to use w3's trick to server xhtml to IE and at
> the same time make the page render in Standards-compliant mode?

Try the proper Doctype:

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

--
Gus

Posted by Zhang Weiwu on January 23, 2007, 9:06 am
Please log in for more thread options


于 Mon, 22 Jan 2007 22:24:31 -0500,Gus Richter写到:

> Zhang Weiwu wrote:
>> http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml
>> webpage to IE as application/xml
>>
>> I used that trick and now every one of my xhtml webpage have following
>> first 4 starting lines:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?xml-stylesheet type="text/xsl" href="curseIE.xsl"?>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml">
>>
>> So is it possible at all to use w3's trick to server xhtml to IE and at
>> the same time make the page render in Standards-compliant mode?
>
> Try the proper Doctype:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

I cannot. That makes all user of my site rely on their connectivity to
w3.org to see MY website. Due to ISP competition (not competing by
providing better access but competing by block other ISP's access) a lot
of Chinese users especially some college students cannot access w3.org
reasonably fast. Now we got a Taiwan earthquake, impossible to fetch this
DTD file for 99% users.

Posted by Jukka K. Korpela on January 23, 2007, 10:12 am
Please log in for more thread options


Scripsit Zhang Weiwu:

>> Try the proper Doctype:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> I cannot.

Yes you can. Besides, it's what you _must_ do in order to conform to the
XHTML specification (when using Strict, but other DOCTYPE alternatives
require the URL as well). Actually you should use HTML 4.01 instead of XHTML
1.0, but that's not relevant here - HTML 4.01 has exactly the same
"problem".

(And you _can_ trim quotations so that you only quote the relevant part in
the message you are commenting on. Please do so in future.)

> That makes all user of my site rely on their connectivity to
> w3.org to see MY website.

Of course not. Browsers don't actually _use_ DOCTYPE declarations for
anything else than making their guess on whether the author wants "standards
mode" or "quirks mode".

Just try it. You can even put www.w3.invalid instead of www.w3.org and
browsers won't still notice anything, beyond (perhaps) switching to "quirks
mode" (since the DOCTYPE declaration as a _string_ isn't in their list of
alternatives that trigger "standards" mode).

Besides, even if browsers actually tried to fetch the DTD, they would be
expected to use the first quoted string to find it in their catalog and only
failing that should they use the second quoted string as a URL. Thus, in
this hypothetical situation, the URL string could only help, not hurt.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by Zhang Weiwu on January 23, 2007, 11:58 am
Please log in for more thread options


于 Tue, 23 Jan 2007 17:12:07 +0200,Jukka K. Korpela写到:
[snip]
>> That makes all user of my site rely on their connectivity to
>> w3.org to see MY website.
>
> Of course not. Browsers don't actually _use_ DOCTYPE declarations for
> anything else than making their guess on whether the author wants "standards
> mode" or "quirks mode".

Please just try it. You already knew the context, that I am trying to ship
xml document to IE and rely on it to treat it as purely xml, call up a XSL
translation and generate an HTML. You knew this context, so it's clear IE
will try to fetch the DTD file (and ent files refered from DTD file). I
have tried it and you can try it too.

I knew browser is expected to not to actually USE doctype declaration, but
does IE often do things you expected? I am surprised to find I must keep
the dtd files on my webserver, too. Acutally browsers should understand
application/xhtml+xml saving all the trouble here but that's IE I am
talking about. (I knew IE never said they support XHTML too.)

> Just try it. You can even put www.w3.invalid instead of www.w3.org and
> browsers won't still notice anything, beyond (perhaps) switching to "quirks
> mode" (since the DOCTYPE declaration as a _string_ isn't in their list of
> alternatives that trigger "standards" mode).
>
> Besides, even if browsers actually tried to fetch the DTD, they would be
> expected to use the first quoted string to find it in their catalog and only
> failing that should they use the second quoted string as a URL. Thus, in
> this hypothetical situation, the URL string could only help, not hurt.

I didn't image this problem, I met this problem. I cannot access my own
website myself in the same office if I keep the correct DOCTYPE
decoration, and I had to ask a friend in German to mail me the DTD fiile
and ent files referred from the DTD file. And since I have been doing web
development for some time, I am getting used to try not to do things the
'correct' way but just do whatever makes IE work.

Similar ThreadsPosted
Serving XHTML as XHTML does *really* weird things. June 18, 2007, 10:46 am
overflow:auto issue in XHTML standards mode October 11, 2006, 10:25 am
No B.S this guy shows the Coolest SEO trick i've seen in a While... January 18, 2008, 5:37 pm
Kiosk Mode Development April 14, 2005, 10:49 pm
Is it simple to use LineDraw characters in
 mode?
August 13, 2005, 6:21 pm
How to view pics in layout mode in Dreamweaver 8? February 12, 2006, 6:23 am
Check whether browser is in quirks or standards mode? April 4, 2007, 3:30 am
How do I turn quirks mode on for XSL generated data in Mozilla? March 9, 2005, 4:52 pm
Unknown Parse Mode! warning from w3c validator with custom doctype September 6, 2005, 11:23 pm
More accurate testing of XHTML documents with XHTML Proxy June 5, 2006, 6:50 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap