473,770 Members | 4,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1769
In article <11************ **********@z14g 2000cwz.googleg roups.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************ **********@z14g 2000cwz.googleg roups.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************ *********@g49g2 000cwa.googlegr oups.com>,
di*****@codesmi ths.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************ *********@g49g2 000cwa.googlegr oups.com>,
di*****@codesmi ths.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*****@codesmi ths.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
3729
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 bug? Can someone excellent to tell me the reason. best wishes
6
2467
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 information for element <elementName>... I would appreciate if anyone could advice where I am going wrong. TIA Here's my xsd:
32
4540
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 the content (MIME) type specified as text/html (http://keystonewebsites.com/articles/mime_type.php). These pages are then loaded on to their Server where they are served to Rendering Agents (browsers) as HTML (SGML application) documents with no...
23
4269
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 application/xhtml+xml MIME type, something that Internet Explorer does not currently support.
8
1956
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 and CSS, and powered by ASP.NET. My first problem, which I'm near to solving, was that ASP.NET doesn't produce valid XHTML output. We don't want to spend money on third-party components, and we can't wait for ASP.NET 2.0, so we needed to find a
24
2646
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="zh-tw" /> knowing all the time as...
22
1928
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 TestText entity is not recognised. In IE6, the <br /> tag doesn't cause a line break. Can anyone tell me what I'm doing wrong?
1
9033
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 impression that XHTML fully supports framesets, hence the Frameset document type. Therefore, can anyone please tell me why the following markup doesn't validate correctly in VS.NET 2005?
4
3040
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 shows up in the browser is: <script type="text/javascript">
4
1740
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); $xmlns = "http://www.w3.org/1999/xhtml";
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.