KuraFire Network


Latest addition: Jan 19, 2007: Times are changing

Log

MIME-type "validation"

· By Faruk Ateş on Nov 16, 2004 · 4 comments ·

Subject level: Advanced

There has been some commotion between XHTML-advocates and XHTML-purists about MIME-types for a while, now. I've added my share to all of that, but today I wrote a little tool related to MIME-types. Originally for myself, but perhaps some other people find it useful, too.

During all the recent discussions about %XHTML% and MIME-types, several people have made the claim that most of the current XHTML sites will not work when sent with an application/xhtml+xml MIME-type. Being curious about such things, I often test out sites to see what kind of header they send. Until today, I was forced to do this by hitting Ctrl-i and checking the Content-type in the Page Info pop-up. Not particularly enjoyable for me.

So, I asked around to see if anyone knew of an existing tool that would let you check a page with an application/xhtml+xml MIME-type: nobody knew of one, so I made one myself. Being the generous, sharing person that I am ;), I present to you, my MIME-type Tool.

Of course, having that tool there wasn't particularly faster than hitting Ctrl-i, so I made <a href="javascript:void(document.location='http://mime.kurafire.net/?uri=' document.location)">a little MIME-type Tool favelet</a>. Just drag that baby to your Personal Toolbar and hit it on any site you're at to check that page with an XHTML MIME-type.

Notes:

  1. You will have to use a Standards-conforming browser for this. Internet Explorer is useless!
  2. This tool will remain there as long as bandwidth usage does not suddenly skyrocket.
  3. Keep in mind that well-formed (XHTML) documents without an XHTML-namespace attribute on the html tag will be treated as XML documents.

For those who think this may be useful (from time to time): enjoy!

Bookmark: Newsvine del.icio.us Digg

Comments

4 comments

#1 · zcorpan · Jun 19, 2005 (14:49)

If you just want to check if it's an XML document or not, you could use javascript:alert(document.xmlVersion ? "XML" : "Not XML") :)

#2 · Henrik Feldt · Aug 23, 2005 (23:15)

Wonderful :) I was thinking about when this would come. Only lil' problem is that I don't understand what your tool does? I have a page compliant to xhtml 1.0 transitional which has the mime type application/xhtml+xml (which btw is optional according to some sources for that doctype) - and this encoding is sent to all clients that can handle it. (checking http.accept)

Trying your tool on my page (http://194.236.30.84/swedendesign2/) simply returns the stripped non-css variant of it without images/flash. How do I know the result of the validation??

#3 · Faruk Ateş · Aug 23, 2005 (23:28)

Henrik,

The tool simply checks for XML well-formedness. If you're using an XHTML-capable browser and check a site with the tool, you'll get a yellow screen of death if it's not well-formed, or just your site without relatively embedded content (css files, flash, etc.) if it is well-formed. :-)

#4 · Henrik Feldt · Aug 27, 2005 (20:35)

Oh :) I see...
Hmm...

All times are in CET. It is now 19:46.