You might want to checkout the HTML sanitizer from the Caja project [1]. You'll need to build it with ant first, but it's pretty good and should be able to do what you want it to.
[1] http://code.google.com/p/google-caja/wiki/JsHtmlSanitizer
[1] http://code.google.com/p/google-caja/wiki/JsHtmlSanitizer
No comments yet.