A bug was filed for extracting errors programatically.( http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27342)
Here is the attached patch for retrieving xml validation errors programatically.
the attached snippet can be used to extract the errors programatically

XmlOptions validateOptions = new XmlOptions();

ArrayList errorList = new ArrayList();

 validateOptions. setValidationErrorListener (errorList);


// Validate the XML.

boolean isValid = newEmp.validate(validateOptions);


     * // If the XML isn't valid, loop through the listener's contents,

     * // printing contained messages.

     * if (!isValid)

     * {

          for (int i = 0; i < errorList.size(); i++)


             XmlValidationError error = (XmlValidationError)errorList.get(i);

             //extract details as necessary



Hope this is useful
With Regards


> ATTACHMENT part 2 application/x-zip-compressed name=changes.zip