E-mail List Archives
Thread: XHTML Content Negotiation revisited
Number of posts in this thread: 8 (In chronological order)
From: James Pickering
Date: Wed, Aug 17 2005 10:40AM
Subject: XHTML Content Negotiation revisited
No previous message | Next message →
(update with re-formulated PHP)
The W3C Tutorial relating to content negotiation http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation mostly relates to Apache. I am working on content-negotiation for my Zeus/3.4 Server. My interim goal is to serve XHTML 1.0 documents as Content-Type application/xhtml+xml -- with XML declaration -- to Firefox browsers and as text/html-- without XML declaration (in order to render in "standards" mode) -- to MSIE browsers.
I have constructed a test page http://www.jp29.org/indexbak.php (a replication of my de facto Home page http://www.jp29.org/ which is served as html 4.01) that I am attempting to serve as application/xhtml+xml in my Firefox 1.0.6 browser and as Content-Type: text/html in my MSIE 6.0 browser.
Checks of my test page served as XHTML 1.0 (strict) Content-Type application/xhtml+xml -- with XML declaration -- in my Firefox 1.0.6 browser:
Firefox Tools/Web Developer/Information/Vew Page Information/View Response Headers
W3C Validator in Verbose mode -- http://validator.w3.org/check?verbose=1&uri=http%3A//www.jp29.org/indexbak.php
Web Caching -- http://www.web-caching.com/showheaders.html
(Added: O'Reilly RUWF facility at http://www.xml.com/pub/a/tools/ruwf/check.html -- for XML being "well formed").
The test page renders as XHTML 1.0 (strict) Content-Type text/html -- without XML declaration -- for me in my MSIE 6.0 browser.
I solicit comments on the validity of my exercise -- and comments in general.
--
James Pickering
From: Tim Beadle
Date: Thu, Aug 18 2005 6:20AM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
On 8/17/05, James Pickering < = EMAIL ADDRESS REMOVED = > wrote:
> I solicit comments on the validity of my exercise -- and comments in
> general.
All good stuff, but as I mentioned before: are you going to fork your
DOM Scripts for the two styles of rendering (text/html vs
application/xhtml+xml) ?
I'd wager that this is a big show stopper. Client-side scripting isn't
evil if done properly, and more and more people are using it to add
value to their web sites and applications.
If you can *guarantee* that you won't be using DOM Scripting in your
site, then sure: go ahead, use content negotiation.
Tim
From: James Pickering
Date: Fri, Aug 19 2005 7:40PM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
Following are the HTTP Request and Response Headers for my Content Negotiation test page http://www.jp29.org/indexbak.php
Firefox 1.0.6 browser:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.jp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Mozilla%2F5.0+%28Windows%3B+U%3B+Windows+NT+5.1%3B+en-US%3B+rv%3A1.7.10%29+Gecko%2F20050716+Firefox%2F1.0.6+Web-Sniffer%2F1.0.21
MSIE 6.0 browser:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.jp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Mozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+98%3B+Win+9x+4.90%3B+.NET+CLR+1.1.4322%29+Web-Sniffer%2F1.0.21
James Pickering
http://www.jp29.org/
From: James Pickering
Date: Fri, Aug 19 2005 9:20PM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
Tim Beadle wrote:
"All good stuff, but as I mentioned before: are you going to fork your
DOM Scripts for the two styles of rendering (text/html vs
application/xhtml+xml) ?"
No, the markup is preset and validated -- the XML is checked for
well-formedness. The PHP scripting is a pre-processor to generate headers
via negotiation.
James Pickering
http://www.jp29.org/
Accessible to People with Disabilities
RSS feed via RDF/XML
From: Tim Beadle
Date: Sat, Aug 20 2005 3:20AM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
On 8/20/05, James Pickering < = EMAIL ADDRESS REMOVED = > wrote:
> Tim Beadle wrote:
> "All good stuff, but as I mentioned before: are you going to fork your
> DOM Scripts for the two styles of rendering (text/html vs
> application/xhtml+xml) ?"
>
> No, the markup is preset and validated -- the XML is checked for
> well-formedness. The PHP scripting is a pre-processor to generate headers
> via negotiation.
Sorry, I probably didn't make myself clear. If you write client-side
DOM Scripts (the new name for DHTML, basically), you will need to use
different DOM methods (document.createElement vs
document.createElementNS) depending on whether your XHTML is served as
text/html or application/xhtml+xml.
I would go and read these articles, before thinking "maybe HTML 4.01
isn't so bad after all" :)
http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html
http://www.hixie.ch/advocacy/xhtml
http://juicystudio.com/article/all-in-the-mime.php
Regards,
Tim
From: James Pickering
Date: Sun, Aug 21 2005 11:20PM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
I am sure you are familiar with the W3C XHTML 1.0 Specification Appendix
C.11. "Document Object Model and XHTML"
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_11
I am indeed well familiar with your cited references. I personally employ
HTML 4.01 (strict) Markup for my Web pages.
James Pickering
http://www.jp29.org/
Accessible to People with Disabilities
RSS feed via RDF/XML
----- Original Message -----
From: "Tim Beadle" < = EMAIL ADDRESS REMOVED = >
To: "WebAIM Discussion List" < = EMAIL ADDRESS REMOVED = >
Sent: Saturday, August 20, 2005 2:08 AM
Subject: Re: [WebAIM] XHTML Content Negotiation revisited
On 8/20/05, James Pickering < = EMAIL ADDRESS REMOVED = > wrote:
> Tim Beadle wrote:
> "All good stuff, but as I mentioned before: are you going to fork your
> DOM Scripts for the two styles of rendering (text/html vs
> application/xhtml+xml) ?"
>
> No, the markup is preset and validated -- the XML is checked for
> well-formedness. The PHP scripting is a pre-processor to generate headers
> via negotiation.
Sorry, I probably didn't make myself clear. If you write client-side
DOM Scripts (the new name for DHTML, basically), you will need to use
different DOM methods (document.createElement vs
document.createElementNS) depending on whether your XHTML is served as
text/html or application/xhtml+xml.
I would go and read these articles, before thinking "maybe HTML 4.01
isn't so bad after all" :)
http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html
http://www.hixie.ch/advocacy/xhtml
http://juicystudio.com/article/all-in-the-mime.php
Regards,
Tim
From: James Pickering
Date: Mon, Aug 29 2005 4:14PM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | Next message →
Two useful resources for those contemplating XHTML 1.0 Content Negotiation:
http://web-sniffer.net
http://www.httpwatch.com/httpgallery/default.htm
--
James Pickering
http://www.jp29.org/indexbak.php
XHTML 1.0 Content negotiation test
From: James Pickering
Date: Mon, Aug 29 2005 4:14PM
Subject: Re: XHTML Content Negotiation revisited
← Previous message | No next message
Objective: To serve XHTML 1.0 documents as Content-Type application/xhtml+xml -- with XML declaration -- to browsers that recognize that MIME type and as text/html -- without XML declaration (in order to render in "standards" mode) -- to other browsers.
Web-Sniffer -- View HTTP Request and Response Header -- reports for http://www.jp29.org/indexbak.php served as XHTML 1.0 via Content-Negotiation:
FireFox 1.0.6 -- MIME Type application/xhtml+xml:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.jp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Mozilla%2F5.0+%28Windows%3B+U%3B+Windows+NT+5.1%3B+en-US%3B+rv%3A1.7.10%29+Gecko%2F20050716+Firefox%2F1.0.6+Web-Sniffer%2F1.0.21
MSIE 6.0 -- MIME Type text/html:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.jp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Mozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+98%3B+Win+9x+4.90%3B+.NET+CLR+1.1.4322%29+Web-Sniffer%2F1.0.21
Netscape Navigator 4.08 -- MIME Type text/html:
http://web-sniffer.net/?url=http%3A%2F%2Fjp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Mozilla%2F4.08+%5Ben%5D+%28WinNT%3B+U+%3BNav%29+Web-Sniffer%2F1.0.21
Opera 8.02 -- MIME Type application/xhtml+xml:
http://web-sniffer.net/?url=http%3A%2F%2Fjp29.org%2Findexbak.php&submit=Submit&http=1.1&gzip=yes&type=GET&ua=Opera%2F8.02+%28Windows+NT+5.1%3B+U%3B+en%29+Web-Sniffer%2F1.0.21
--
James Pickering
http://www.jp29.org/
Content Negotiation test