Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 17th, 2005, 01:05 AM
James Pickering
Guest
 
Posts: n/a
Default XHTML 1.0 Content-Negotiation

(update with re-formulated PHP)

The W3C Tutorial relating to content negotiation
http://www.w3.org/2003/01/xhtml-mime...nt-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?verbos...g/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

  #2  
Old August 17th, 2005, 06:25 AM
Henri Sivonen
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

In article <1124236843.128891.323240@z14g2000cwz.googlegroups .com>,
"James Pickering" <jp29@cox.net> wrote:
[color=blue]
> 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.[/color]

Why?

Wouldn't it be simpler and more cacheable to serve HTML 4.01 to all UAs?

--
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
  #3  
Old August 17th, 2005, 06:35 AM
James Pickering
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

Henri Sivonen wrote:[color=blue]
> In article <1124236843.128891.323240@z14g2000cwz.googlegroups .com>,
> "James Pickering" <jp29@cox.net> wrote:
>[color=green]
> > 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.[/color]
>
> Why?
>
> Wouldn't it be simpler and more cacheable to serve HTML 4.01 to all UAs?[/color]

Yes -- that is what I do. This is just an exercise to see if I can
effect Content-Negotiation for the Zeus server as requested in the W3C
document relating to this subject.

James Pickering

  #4  
Old August 17th, 2005, 10:25 AM
dingbat@codesmiths.com
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

Henri Sivonen wrote:
[color=blue]
> Why?[/color]

Because it's there?

This is obviously currently a pointless exercise. I wouldn't do it
myself - personally I'd serve Appendix C to everyone. But none of this
is a reason why it _shouldn't_ be done.

Actually it's an interesting exercise to serve real XML-XHTML to those
that can take it - it would avoid the ugly hack of hiding my embedded
RDF metadata away as comments in the header. James and I do seem to be
the only people still pursuing that route 8-)


FF1.0.6 seems to be working perfectly for me.

  #5  
Old August 17th, 2005, 05:15 PM
Henri Sivonen
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

In article <1124270153.338324.96550@g49g2000cwa.googlegroups. com>,
dingbat@codesmiths.com wrote:
[color=blue]
> But none of this
> is a reason why it _shouldn't_ be done.[/color]

However, see
http://www.mozilla.org/docs/web-deve...aq.html#accept
[color=blue]
> Actually it's an interesting exercise to serve real XML-XHTML to those
> that can take it - it would avoid the ugly hack of hiding my embedded
> RDF metadata away as comments in the header.[/color]

RDF in comments "parsed" with regexps is so bogus it is not even funny.

--
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
  #6  
Old August 17th, 2005, 05:45 PM
James Pickering
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

Henri Sivonen wrote:[color=blue]
> In article <1124270153.338324.96550@g49g2000cwa.googlegroups. com>,
> dingbat@codesmiths.com wrote:
>[color=green]
> > But none of this
> > is a reason why it _shouldn't_ be done.[/color]
>
> However, see
> http://www.mozilla.org/docs/web-deve...aq.html#accept[/color]

That is very interesting. It seems that the W3C and Mozilla need to get
together on this -- I will post the link on the W3C QA Forum for
commentary.

--

James Pickering
http://www.jp29.org/

  #7  
Old August 17th, 2005, 06:05 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

dingbat@codesmiths.com wrote:
[color=blue]
> Actually it's an interesting exercise to serve real XML-XHTML to those
> that can take it - it would avoid the ugly hack of hiding my embedded
> RDF metadata away as comments in the header.[/color]

If you're mixing RDF and (X)HTML, what you want is the relevant
Namespace modules to filter them on the fly. See for example
http://www.xml.com/pub/a/2004/12/15/...amespaces.html

--
Nick Kew
  #8  
Old August 20th, 2005, 03:05 AM
James Pickering
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

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%...iffer%2F1.0.21


MSIE 6.0 browser:

http://web-sniffer.net/?url=http%3A%...iffer%2F1.0.21

--
James Pickering
http://www.jp29.org/

  #9  
Old August 22nd, 2005, 06:35 PM
James Pickering
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

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://jp29.org/indexbak.php
XHTML 1.0 Content negotiation test

  #10  
Old August 23rd, 2005, 07:15 PM
James Pickering
Guest
 
Posts: n/a
Default Re: XHTML 1.0 Content-Negotiation

Update ..........

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%...iffer%2F1.0.21

MSIE 6.0 -- MIME Type text/html:
http://web-sniffer.net/?url=http%3A%...iffer%2F1.0.21

Netscape Navigator 4.08 -- MIME Type text/html:
http://web-sniffer.net/?url=http%3A%...iffer%2F1.0.21

Opera 8.02 -- MIME Type application/xhtml+xml:
http://web-sniffer.net/?url=http%3A%...iffer%2F1.0.21

--
James Pickering
http://www.jp29.org/indexbak.php
Content Negotiation test

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles