On Mon, May 12, 2008 at 10:57 PM, XStandard Vlad Alexander <[EMAIL PROTECTED]> wrote: > HTH wrote: > >...server has to do content negotiation in order to send > > >text/html with one doctype (HTML or XHTML 1.0) to IE users and > >application/xhtml+xml/XHTML 1.1 to everyone else. That means > >you're generating two copies of all of your content > Assuming your are not writing static pages, you only need to generate one > copy of content in XHTML 1.1 format and then serve it as any version of HTML > as you like.
I'm not sure what you mean -- I understand the XHTML 1.1 part, but what do you mean then by "serve it as any version of HTML"? Are you talking about putting an HTML doctype on XHTML 1.1-formatted code, or serving XHTML 1.1 with the text/html media type, or something else? > HTH wrote: > > Furthermore, content negotiation itself is some work to > > get done correctly > At most, maybe 10 lines of code. Please see: > http://xhtml.com/en/content-negotiation/ My point exactly -- that code is not correct. It produces the wrong result when presented with an Accept header of */* which is valid (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1) and indicates that the client can accept application/xhtml+xml. The code is also wrong in that the Accept header can contain preference indicators ("q=..."). It's valid for a client to indicate that it accept both text/html and application/xhtml+xml but prefers the former. A straightforward substring search won't get the job done correctly. It's true that these are unusual cases and the consequences of getting it wrong are minor (text/html sent instead of application/xhtml+xml). But my point was that it is easy to make mistakes, even if you're getting it right most of the time. There was a recent discussion (pretty vocal, if I remember correctly) on the W3 Validator list about the subject of content negotiation involving people with a deeper understanding and appreciation of the standards than me. You might find it interesting reading. Cheers -- Philip http://NikitaTheSpider.com/ Whole-site HTML validation, link checking and more ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************
