Validate xml with dsx and getting a list of validation errors

Hello.

I need to validate an xml files with xsd and obtain list of validation errors. Is this even possible?

What I've been doing so far is:

DocumentBuilder parser = dbf.newDocumentBuilder();// this is from javax.xml.parsers

Validator handler =new Validator();

parser.setErrorHandler(handler);

Document doc = parser.parse(new InputSource(is) );

if (handler.validationError)

throw handler.saxParseException;

else

return doc;

and then if there is an exception, I look at its content to know what the validation error is. This is fine except it only gives me the first validation error! What do I have to do to know all the other ones?

Thanks

[951 byte] By [poringa] at [2007-11-26 21:33:23]
# 1
Are you getting an error or fatal error? Is your error handler returning or throwing an exception?
spericasa at 2007-7-10 3:14:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...