473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Aug 17 '05 #1
9 1736
In article <11**********************@z14g2000cwz.googlegroups .com>,
"James Pickering" <jp**@cox.net> wrote:
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.


Why?

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

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Aug 17 '05 #2
Henri Sivonen wrote:
In article <11**********************@z14g2000cwz.googlegroups .com>,
"James Pickering" <jp**@cox.net> wrote:
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.


Why?

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


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

Aug 17 '05 #3
Henri Sivonen wrote:
Why?


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.

Aug 17 '05 #4
In article <11*********************@g49g2000cwa.googlegroups. com>,
di*****@codesmiths.com wrote:
But none of this
is a reason why it _shouldn't_ be done.
However, see
http://www.mozilla.org/docs/web-deve...aq.html#accept
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.


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

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Aug 17 '05 #5
Henri Sivonen wrote:
In article <11*********************@g49g2000cwa.googlegroups. com>,
di*****@codesmiths.com wrote:
But none of this
is a reason why it _shouldn't_ be done.


However, see
http://www.mozilla.org/docs/web-deve...aq.html#accept


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/

Aug 17 '05 #6
di*****@codesmiths.com wrote:
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.


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
Aug 17 '05 #7
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/

Aug 20 '05 #8
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

Aug 22 '05 #9
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

Aug 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: mike | last post by:
regards: I use Jtidy (api) to translate a HTML file into a "XHTML file". But The "XHTML file" cannot be identified by nokia 6600. Do I miss something important? Or this is Jtidy's weakness or...
6
by: Wole Ogunremi | last post by:
I guess this is a well asked question but it is tripping me up! I'm putting a forum together allowing xhtml markup content. I am validating against a schema but getting "Could not find schema...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
23
by: Gustaf | last post by:
I just read this article from today: http://webstandards.org/buzz/archive/2005_09.html I need some help understanding this sentense: The W3C recommends XHTML 1.1 should be served with the...
8
by: Anthony Williams | last post by:
Morning all, I'm having a wee problem with a project I'm working on at the moment. I'm leading my company into producing a website, based upon Web Standards, which will be created using XHTML...
24
by: Dan Jacobson | last post by:
I shall jump on the XHTML bandwagon. I run my perfectly good html4/strict pages thru $ tidy -asxhtml -utf8 #to get: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"...
22
by: Ted | last post by:
This page http://homepage.ntlworld.com/r.a.mccartney/test/utf-8_test_file_hacked_for_ie_with_local_dtd.xml doesn't work properly in Firefox or IE6. The faults are different. In Firefox the...
1
by: Mark Rae | last post by:
Hi, Firstly, I have not the slightest intention of using framesets - the reason for this post is merely to ask for assistance in furthering my understanding of XHTML. I was under the...
4
by: Narven | last post by:
Hi, I've been creating a script that dynamic loads js files. but after creating that script, (and i use document.createElement('script');) in that function.. i've realise that the code that...
4
by: Marijn | last post by:
Hey everybody, The following has been posted before (2 years ago) but no response was added. Therefor again, the following code for creating xhtml file: <?php error_reporting(6143); ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.