I'm trying to undestand the impact of using content negotiation when
rendering my Web pages to various different browsers as I would like to
use the XHTML Strict DOCTYPE declaration. Reading the W3C guidelines,
if I render as 'text/html' then there are some backward compatibility
issues I need to worry about. Does this mean that the page must be
rendered in one way if I use the "application/xhmlt+xml" content type
and another if I use the "text/html" content type? This would mean
parsing of every page on the site.... Or, if I follow the backward
compatibility rules from the W3C, will it render properly regardless
of the content-type for a particular request?
Thanks 9 1916
wardy wrote: I'm trying to undestand the impact of using content negotiation when rendering my Web pages to various different browsers as I would like to use the XHTML Strict DOCTYPE declaration. Reading the W3C guidelines, if I render as 'text/html' then there are some backward compatibility issues I need to worry about.
If you serve as text/html then some browsers will render the document in
ways you don't like (splattering the page with ">" characters whereever you
have an <img />, <br />, <hr /> and so on).
Does this mean that the page must be rendered in one way if I use the "application/xhmlt+xml" content type and another if I use the "text/html" content type?
If it is served as text/html then it will be parsed with a tag soup slurper.
If it is served as application/xhtml+xml then it will be parsed with an XML
parser (which means IE will prompt user's to download it, and Firefox won't
render it until the entire document is downloaded and parsed, and will spit
errors at the user instead of trying to recover if the document isn't well
formed).
There are no differences in how browsers are supposed to render XHTML and
HTML (although there /are/ rules as to how CSS is applied which could
influence the rendering (e.g. class selectors are HTML only and don't apply
to XHTML, and the root element is <html> instead of <body>).
This would mean parsing of every page on the site....
Browsers have to parse every page they display.
Or, if I follow the backward compatibility rules from the W3C, will it render properly regardless of the content-type for a particular request?
No. At present, unless you have need of something that only XHTML can
provide on the client (like mixed-namespace documents), stick to HTML. (By
all means _write_ XHTML, but transform it to HTML before it gets to the
client).
The Mozilla FAQ states that the only reason application/xhtml+xml has a
higher quality value than text/html in the Accept request header, is so
that the browser will get MathML versions of documents. They advise the use
of HTML 4.01 Strict.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
wardy wrote: I'm trying to undestand the impact of using content negotiation when rendering my Web pages to various different browsers as I would like to use the XHTML Strict DOCTYPE declaration. Reading the W3C guidelines, if I render as 'text/html' then there are some backward compatibility issues I need to worry about.
Yep. It's not that onerous unless your pages are generated by XML
tools that don't grok "Appendix C". If that is an issue, filter them
through mod_xhtml. Or - if they're static - equivalent preprocessor.
Does this mean that the page must be rendered in one way if I use the "application/xhmlt+xml" content type and another if I use the "text/html" content type?
That's up to the user agent. Normal browsers are happy with text/html
and HTML 4, but will accept xhtml as a second choice. MSIE will _only_
accept xhtml when it's served as text/html+tagsoup. But if you're
(also) serving to non-browsers, you'll have to work with whatever
they like.
--
Nick Kew
David Dorward wrote: (e.g. class selectors are HTML only and don't apply to XHTML [...]).
Since when? Class selectors apply to any XML document in which the UA
has namespace specific knowledge of a class attribute. The spec
explicitly states that and goes on to provide examples of the SVG and
MathML class attributes, so there is no reason why they don't apply to
XHTML.
--
Lachlan Hunt http://lachy.id.au/ http://GetFirefox.com/ Rediscover the Web http://GetThunderbird.com/ Reclaim your Inbox
Lachlan Hunt wrote: David Dorward wrote: (e.g. class selectors are HTML only and don't apply to XHTML [...]). Since when?
Since CSS 2.
"For style sheets used with HTML"
-- http://www.w3.org/TR/CSS2/selector.html#class-html
Class selectors apply to any XML document in which the UA has namespace specific knowledge of a class attribute.
Ah. I see they've changed that in CSS 2.1, thank goodness for that. Still a
working draft though.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Great....thanks for the info all. I thought that I had read that
rendering XHTML to MSIE as text/html actually invokes almost standards
mode, and not quirks/tag soup mode. Is that not correct?
When rendering XHTML as text/html, would I need to worry about putting
the meta tag for the content type if I am already setting this in th
headers on the server? I wouldn't think so, but then how do I indicate
to use a different charset than the default UTF-8 or UTF-16 designation
for a text/html page?
Thanks
wardy wrote: Great....thanks for the info all. I thought that I had read that rendering XHTML to MSIE as text/html actually invokes almost standards mode, and not quirks/tag soup mode. Is that not correct?
AFAIK MSIE doesn't have an 'almost standards' mode, just standards and
quirks. And both (all three in other browsers) rendering modes are
HTML/tag soup rendering modes. Rendering XHTML as XHTML is something
else again.
Steve
On 8 Feb 2006, wardy wrote: but then how do I indicate to use a different charset than the default UTF-8 or UTF-16 designation for a text/html page?
That depends on your server software; read http://www.w3.org/International/O-HTTP-charset.html
There is no default encoding (charset) for a "text/html page".
--
All free men, wherever they may live, are citizens of Denmark.
And therefore, as a free man, I take pride in the words "Jeg er dansker!"
David Dorward wrote: If you serve as text/html then some browsers will render the document in ways you don't like (splattering the page with ">" characters whereever you have an <img />, <br />, <hr /> and so on).
Yes, and if you don't wear the tinfoil hat then the Chinese Google Rays
will eat you.
In practice, out in the real world, this just doesn't happen. It
_could_ happen (apparently a variant of emacs that grew beyond reading
mail and sprouted a web client did this), but it's just not something
to worry about.
Andy Dingley wrote: In practice, out in the real world, this just doesn't happen. It _could_ happen (apparently a variant of emacs that grew beyond reading mail and sprouted a web client did this)
Umm. No. That's emacs. And the standard web browser for emacs, and that's
just one example. Anything that deals with HTML as SGML will do that.
, but it's just not something to worry about.
Advantages of serving XHTML as text/html to the client: Zip
Disadvantages of serving XHTML as text/html to the client: Minor
The disadvantages outweigh the advantages. Welcome back HTML 4.01.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gene Ellis |
last post by:
Something strange is happening, but I bet it is a quick fix. My
favicon image is showing up in the URL bar, for a couple of seconds,
but then it disappears and the default browser icon is...
|
by: Stromboli |
last post by:
Hi,
I have my site available in a couple of languages most of the files
are indexf.html (french), indexi.html (italian) and indexde.html
(german)..
I'd like to start using multiviews but I've...
|
by: James Pickering |
last post by:
(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...
|
by: dalyian39 |
last post by:
Hello,
I'm pretty new to PHP but I have a page, B.php, which runs fine, but I
want to be able to call this as B (long story), i.e.
http://mysite/B?foo=bar should be equivalent to calling...
|
by: Manfred Kooistra |
last post by:
I am building a website with identical content in four different
languages. On a first visit, the search engine determines the language
of the content by the IP address of the visitor. What the...
|
by: alexsink |
last post by:
I am trying to get apache content negotiation to redirect only
zh-CN(mainland China, where Simplified Chinese translations are
available) language types to Chinese web pages, and have all other...
|
by: visu |
last post by:
Hi this is a question asked in this group two years back..
No answer for this question till date.
now i am in the same situation of the questioner.. to find a solution
for this problem.
Can any...
|
by: pbd22 |
last post by:
Hi.
This is just a disaster management question.
I am using XMLHTTP for the dynamic loading of content in a very
crucial area of my web site. Same as an IFrame, but using XMLHTTP and
a DIV. I...
|
by: Ken Fine |
last post by:
I have been investigating programmatically downloading FLV content from
various sites ("video scraping"??)
Many interactive GUI tools do this, such as the Orbit downloader. At the
heart of them...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |