http://validator.w3.org/source/
or WDG:
http://www.htmlhelp.com/tools/validator/source.html
validators.
It's possible to install these tools on LINUX using PPM but being able to hack them and the associated C libraries to work on OSX is way beyond my capabilities.
But then it occurred to me I already have an application which does HTML validation which works on OSX - BBEdit. Is it a crazy idea that it might be possible to pipe a file or string to BBEdit's "Check Syntax" command and retrieve the output? Where would I start with something like that?