I am using javax.xml.validation.Validator from SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) to perform XSD validation.
I would like to be able to get a better error message back for validation errors.
All I currently get is:
org.xml.sax.SAXParseException: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'TypeCode'.
Is it possible to have the error print out which element or xml fragment is failing validation?
*Edit: I am using the standard java6 xml parsers *Edit2: Sorry for not mentioning - I am using JAXB to read the XML with a contenthandler and a listener (due to the XML being > 1GB most of the time).