views:

150

answers:

3

Clarification: Thanks for the suggestions of tools for validating XHTML. I'm primarily looking for a solution that will run server side (or on the client with jQuery) so i can set it and forget it during development - and get told when I have issues without having to run a tool all the time.


All this tag soup stuff scares me with ASP.NET MVC !!

I'd be less scared if I could validate each and every view coming out of my view generator for XHTML compliance. This is especially important with the amount of jQuery I am planning on writing. i dont want to spend hours debugging something just to find out I had an unclosed tag somewhere that prevented a selector from working.

What options are there for this. Off the top of my head I'm looking for solutions like the following, but not sure which of these are practical:

  • JQuery XHTML checker
  • IIS filter
  • Browser plugin (I assume theres something for Firebug plugin to do this)
  • Doing something clever with the MVC View classes (I'm not sure if this is possible or worthwhile persuing).
  • Modifying the HTML writer to check on 'flush()' and throw an exception if the output is not XHTML.
  • ASP.NET configuration option I'm not aware of to validate the page.

All options welcome answers !

I'd prefer a server side technology so during debugging I can throw a hard exception, and in production I can log any errors. It must validate the full page after the master page has been applied. Looking for warnings in the IDE is not a good enough solution!

+2  A: 

As a plugin there's HTML Validator for Firefox.

Ionuț G. Stan
i just installed this. the XHTML state of the document seems a little buried in all the miscellaneous HTML errors, but ill play with it some more. while i care about HTML compliance somewhat I care less if i'm missing a 'type' tag than if my document isnt symantically correct in its most basic form
Simon_Weaver
You should at least avoid errors (with red circles).
Ionuț G. Stan
A: 

w3c html validator is avalable as source so you can download it and do prety much anything you want with it. You could set it up with a list of URLs to constantly crawl your test server and log any errors.

Jeremy French
A: 

As Jeremy said, the W3C validator is out there, but on a side note to check for the accessibility of your views/ site you can you TAW.

I realise this is slightly off topic, but it's still in an important part of web-site development.

Kieron