<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: From the Top: MIME and Content Negotiation</title>
	<atom:link href="http://multicelldesign.com/2006/01/content-negotiation/feed/" rel="self" type="application/rss+xml" />
	<link>http://multicelldesign.com/2006/01/content-negotiation/</link>
	<description>shokunin kishitsu</description>
	<lastBuildDate>Mon, 28 Nov 2011 19:43:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Torsten</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-88</link>
		<dc:creator>Torsten</dc:creator>
		<pubDate>Tue, 17 Jan 2006 01:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-88</guid>
		<description>Neil, my apologies.  I&#039;ve just looked over your script again and I realise I was reading it all wrong.  Your initial stristr search for the string application/xhtml+xml is sufficient, and the reg exp only comes in to play if a q value of anything less than 1 is specified in the accept header.  The logic threw me initially, but I see now that it would work perfectly well.</description>
		<content:encoded><![CDATA[<p>Neil, my apologies.  I&#8217;ve just looked over your script again and I realise I was reading it all wrong.  Your initial stristr search for the string application/xhtml+xml is sufficient, and the reg exp only comes in to play if a q value of anything less than 1 is specified in the accept header.  The logic threw me initially, but I see now that it would work perfectly well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Dawson</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-87</link>
		<dc:creator>Karl Dawson</dc:creator>
		<pubDate>Mon, 16 Jan 2006 21:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-87</guid>
		<description>Update to article:

Clarified and expanded on the fact that the &lt;abbr title=&quot;Extensible Markup Language&quot;&gt;XML&lt;/abbr&gt; Declaration and XML-stylesheet reference (along with the DOCTYPE) are part of the &lt;abbr title=&quot;Extensible Markup Language&quot;&gt;XML&lt;/abbr&gt; Prolog - and how to write  each part.

Clarified that &apos; is unsupported in &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; 4.

Reworked &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; comments in scripts.

Added Point 11 in &quot;Doing the Right Thing&quot; section.

My thanks to Lachlan Hunt, Jukka K. Korpela, &lt;a href=&quot;http://sitesurgeon.co.uk/&quot; rel=&quot;nofollow&quot;&gt;Ben Millard&lt;/a&gt; and Torsten (above and forum member at &lt;a href=&quot;http://www.accessify.com&quot; rel=&quot;nofollow&quot;&gt;Accessify.com&lt;/a&gt;)</description>
		<content:encoded><![CDATA[<p>Update to article:</p>
<p>Clarified and expanded on the fact that the <abbr title="Extensible Markup Language">XML</abbr> Declaration and XML-stylesheet reference (along with the DOCTYPE) are part of the <abbr title="Extensible Markup Language">XML</abbr> Prolog &#8211; and how to write  each part.</p>
<p>Clarified that &amp;apos; is unsupported in <abbr title="Hypertext Markup Language">HTML</abbr> 4.</p>
<p>Reworked <abbr title="Hypertext Markup Language">HTML</abbr> comments in scripts.</p>
<p>Added Point 11 in &#8220;Doing the Right Thing&#8221; section.</p>
<p>My thanks to Lachlan Hunt, Jukka K. Korpela, <a href="http://sitesurgeon.co.uk/" rel="nofollow">Ben Millard</a> and Torsten (above and forum member at <a href="http://www.accessify.com" rel="nofollow">Accessify.com</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Torsten</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-86</link>
		<dc:creator>Torsten</dc:creator>
		<pubDate>Mon, 16 Jan 2006 20:30:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-86</guid>
		<description>Hi Neil,

As I say, I&#039;m not an expert, but I am rather surprised that it works.

The accept header for Firefox 1.07 under GNU/Linux is as follows -

&lt;pre&gt;&lt;code&gt;text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;/code&gt;&lt;/pre&gt;

...your regular expression doesn&#039;t match anything in that string.  By my understanding your script would therefore serve text/html to Firefox when, according to its accept header anyway, it prefers application/xhtml+xml.

I just had a look at Simon&#039;s article and his reg exp seems much better.  It is in fact very similar to the one I use myself:

&lt;code&gt;$htmlmimetype = &#039;/text\/html(?:;q=([01](?:\.\d{1,3})?))?/i&#039;;
$xhtmlmimetype = &#039;/application\/xhtml\+xml(?:;q=([01](?:\.\d{1,3})?))?/i&#039;;&lt;/code&gt;

...so I would say that wouldn&#039;t I ;o)</description>
		<content:encoded><![CDATA[<p>Hi Neil,</p>
<p>As I say, I&#8217;m not an expert, but I am rather surprised that it works.</p>
<p>The accept header for Firefox 1.07 under GNU/Linux is as follows -</p>
<pre><code>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</code></pre>
<p>&#8230;your regular expression doesn&#8217;t match anything in that string.  By my understanding your script would therefore serve text/html to Firefox when, according to its accept header anyway, it prefers application/xhtml+xml.</p>
<p>I just had a look at Simon&#8217;s article and his reg exp seems much better.  It is in fact very similar to the one I use myself:</p>
<p><code>$htmlmimetype = '/text\/html(?:;q=([01](?:\.\d{1,3})?))?/i';<br />
$xhtmlmimetype = '/application\/xhtml\+xml(?:;q=([01](?:\.\d{1,3})?))?/i';</code></p>
<p>&#8230;so I would say that wouldn&#8217;t I ;o)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Crosby</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-85</link>
		<dc:creator>Neil Crosby</dc:creator>
		<pubDate>Mon, 16 Jan 2006 19:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-85</guid>
		<description>And yes, my article is based on Simon&#039;s original work - it wouldn&#039;t have been written if he hadn&#039;t done his stuff first.</description>
		<content:encoded><![CDATA[<p>And yes, my article is based on Simon&#8217;s original work &#8211; it wouldn&#8217;t have been written if he hadn&#8217;t done his stuff first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Crosby</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-84</link>
		<dc:creator>Neil Crosby</dc:creator>
		<pubDate>Mon, 16 Jan 2006 19:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-84</guid>
		<description>Thanks for the link through to my article Karl - it was a nice surprise to come home from work to.

Torsten: I can&#039;t recall my exact thinking behind using that regex in that way, but what I can say is that I&#039;ve been using that script (or versions of it) for about two years now, and I haven&#039;t had it blow up in my face yet.

I&#039;ve just had a quick play with Firefox, changing &quot;network.http.accept.default&quot; (vie about:config) to contain various different q-values and I couldn&#039;t get the script to do anything unexpected.  &lt;strong&gt;However&lt;/strong&gt; I am not convinced that you don&#039;t (whoa, too many negatives there) have a point, so I&#039;m going to go back and have a proper look at the script later in the week.</description>
		<content:encoded><![CDATA[<p>Thanks for the link through to my article Karl &#8211; it was a nice surprise to come home from work to.</p>
<p>Torsten: I can&#8217;t recall my exact thinking behind using that regex in that way, but what I can say is that I&#8217;ve been using that script (or versions of it) for about two years now, and I haven&#8217;t had it blow up in my face yet.</p>
<p>I&#8217;ve just had a quick play with Firefox, changing &#8220;network.http.accept.default&#8221; (vie about:config) to contain various different q-values and I couldn&#8217;t get the script to do anything unexpected.  <strong>However</strong> I am not convinced that you don&#8217;t (whoa, too many negatives there) have a point, so I&#8217;m going to go back and have a proper look at the script later in the week.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Jessey</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-83</link>
		<dc:creator>Simon Jessey</dc:creator>
		<pubDate>Mon, 16 Jan 2006 18:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-83</guid>
		<description>&lt;blockquote&gt;The following code snippet is a small modification to Neil Crosbyâ€™s original work.&lt;/blockquote&gt;

Actually, Neil&#039;s work is based on an &lt;a href=&quot;http://keystonewebsites.com/articles/mime_type.php&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; that I wrote in &lt;a href=&quot;http://jessey.net/blog/2003/oct/&quot; rel=&quot;nofollow&quot;&gt;October 2003&lt;/a&gt; (which you cite in your references).</description>
		<content:encoded><![CDATA[<blockquote><p>The following code snippet is a small modification to Neil Crosbyâ€™s original work.</p></blockquote>
<p>Actually, Neil&#8217;s work is based on an <a href="http://keystonewebsites.com/articles/mime_type.php" rel="nofollow">article</a> that I wrote in <a href="http://jessey.net/blog/2003/oct/" rel="nofollow">October 2003</a> (which you cite in your references).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Torsten</title>
		<link>http://multicelldesign.com/2006/01/content-negotiation/comment-page-1/#comment-82</link>
		<dc:creator>Torsten</dc:creator>
		<pubDate>Mon, 16 Jan 2006 16:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.thatstandardsguy.co.uk/2006/01/13/from-the-top-content-negotiation/#comment-82</guid>
		<description>Nice article TSG.  Couple of additional comments/points:

It might also be worth mentioning that &lt;a href=&quot;http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx&quot; rel=&quot;nofollow&quot;&gt;IE7 will not support application/xhtml+xml&lt;/a&gt; either.

I&#039;m not an expert on PHP, or regular expressions for that matter, but I believe the example PHP script is inappropriate. The regular expression:

&lt;code&gt;/application\/xhtml\+xml;q=0(\.[1-9]+)/i&lt;/code&gt;

will only match a fractional &#039;q&#039; value. As you said in your write up, the absence of a q value implies a q value of 1 which the example script also doesn&#039;t cater for.

Keep up the good work.</description>
		<content:encoded><![CDATA[<p>Nice article TSG.  Couple of additional comments/points:</p>
<p>It might also be worth mentioning that <a href="http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx" rel="nofollow">IE7 will not support application/xhtml+xml</a> either.</p>
<p>I&#8217;m not an expert on PHP, or regular expressions for that matter, but I believe the example PHP script is inappropriate. The regular expression:</p>
<p><code>/application\/xhtml\+xml;q=0(\.[1-9]+)/i</code></p>
<p>will only match a fractional &#8216;q&#8217; value. As you said in your write up, the absence of a q value implies a q value of 1 which the example script also doesn&#8217;t cater for.</p>
<p>Keep up the good work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

