XhtmlValidator - Validate XHTML in Java
DDA compliance has been a client request for both of the last two projects I’ve been working on. With good reason, too, I believe. The web standards are there, but not many people seem to be following them. Just run any of the sites you regularly visit through the W3C Validator and you’ll be surprised to find out how few of them actually pass as valid XHTML documents. Valid XHTML does not solve semantics issues, nor does it by any means make a page DDA compliant, it is however one step closer to the right direction.
Bearing this in mind, XhtmlValidator is a nano-library (somehow library is too heavy a word for such a simple thing, we are open to suggestions…) for validating XHTML documents in Java. It was written to serve the purpose of easily validating XHTML in a programmatic manner. For instance, it can be integrated in the automated acceptance test process (FIT, etc) to ensure the validity of XHTML for every page under test.
We hope it comes in handy and we’d like to hear suggestions on how it could be improved in order to become a useful tool in the quest for a more standards friendly web.

June 7th, 2006 at 2:44 pm
How is this different than simply using the XHTML DTDs and running them through a validating XML parser?
June 7th, 2006 at 6:30 pm
That’s more of less what it is, packaged in a jar, allowing you to do what you described with one method call.
June 10th, 2006 at 9:26 pm
Well, what really is useful here is the entity resolving part that uses local DTD:s for speed. Just what I was looking for - thanks!
August 30th, 2006 at 12:10 pm
The errors returned from the isValid() method return 1 error only while the stream contains many errors!
August 30th, 2006 at 7:43 pm
Ahmed,
Thanks for letting us know.
The problem should be fixed in xhtmlvalidator-v0.2, available at the XhtmlValidator distribution directory.