Error messages that tell you what's wrong, but not what's right

So I'm trying to do the right thing and validate a web page to ensure it's XHTML compliant.  Here's the result:

Sorry, I am unable to validate this document because its content type is text/plain, which is not currently supported by this service.

OK, great.  You can't handle text/plain.  I'm sorry.  So what do you handle?  What do I need to do to resolve this?

Unfortunately, this type of error message is quite common.  If you can give an error description this specific, it's also possible to give the user instructions on how to avoid the error.  The users are your friends -- help them out.


  • Not only this, error messages should hava a link to a website that could have much more detail about the problem and solution than the typical terse message. For example, Microsoft could put a link in all their error mesages that pointed to a support article or list of articles. Also, add some detail about the error link in a querystring to further fine tune the solution provided. They could log all the hits they get from these error message links and build up a database of error inquiries to highlight where they need to make improvements.

  • Jeff, even when you add those tags you still need to setup your web server so it serves HTML as HTML, not as plain text. You complaining about that is like me having an executable named program.txt and complaining that Windows won't execute it (it actually will but not from the shell).

    As for what the W3C's HTML/XHTML validator handles - HTML (text/html) and XHTML (application/xhtml+xml). They don't try to validate plain text (there are no rules as to how should a plain text document be structured). Unfortunatelly the best browser on the Earth does not handle XHTML very well...

  • i was just bloggin 'bout this last week -- as clarson says, links to relevant articles would be excellent.

    if big software companies did this, it would also lift a few technical writers out of the ranks of the unemployed :+)



  • Jerry: The site has an textbox to upload a web page. I save the HTML from a page and uploaded it. What did I do wrong?

    clarson: Definitely agree. Nice to see that MSFT is starting to do this in some areas. I hope the trend continues.

  • Jeff - if you use the file upload then you did nothing wrong, but since you're not uploading the response headers (because you simple can't, no fault at anyone's end) you need to explicitly set your content type and encoding. The validator is really built to validate live pages by pulling them off of the web server, since HTTP pushes a lot of metadata with each response that is not preserved when you save the HTML content to a text file.

    Or you may just need to save the file as .html, not .txt (since your browser will set the content-type on the file you upload, text/plain in case of .txt files).

Comments have been disabled for this content.