JAXB validation - how to throw an exception
I am using JAXB ( JDK 1.6 ), I have a ValidationEventHandler,
I am validating each .xml file against a .xsd; when this fails the ValidationEventHandler is called; Inside the validation handler, I simply print out the tags not expected;
I need to know when this validation handler is called to handle additional logic; If the validation handler would run and then throw an exception, I could do what I need, but it does not throw an exception, and I cannot throw an exception inside the handler.
If the XML file could not be validated, I want to move the file to another directory but I see no way to do this; if there is a way, please let me know. Please respond only if you have a solution that will work.