Foolproof HTML
> If you have a good strategy for validating your template files, I'd love to hear it!<p>Use S-expression syntax instead of SGML syntax, i.e. instead of:<p><tag attr=value ...>content</attr><p>write<p>((tag attr value ...) content)<p>and use Lisp to process it.  It's actually quite straightforward.  You can apply it to XML as well.  Everything actually ends up looking a lot prettier this way.<p>See <a href="http://weitz.de/cl-who/" rel="nofollow">http://weitz.de/cl-who/</a> for an example of an implemented system that works this way.  I've been using it in production for years.  It works like a charm.