//
binder = jc.createBinder();
log.debug("info: " + binder.getClass().getName());
JaxbValidationEventHandler eventHandler = new JaxbValidationEventHandler();
eventHandler.setContinue(false);
binder.setEventHandler(eventHandler);
try {
unwrapUsually(binder, doc); // unlikely to need this in the code below
} catch (Exception ue) {
if (ue instanceof UnmarshalException) {
// Usually..
} else {
// eg java.lang.NumberFormatException
log.error( ue.getMessage(), ue);
}
if (is.markSupported() ) {
// When reading from zip, we use a ByteArrayInputStream,
// which does support this.
log.info("encountered unexpected content; pre-processing");
/* Always try our preprocessor, since if what is first encountered is
* eg:
*
<w14:glow w14:rad="101600"> ...
*
* the error would be:
*
* unexpected element (uri:"http://schemas.microsoft.com/office/word/2010/wordml", local:"glow")
*
* but there could well be mc:AlternateContent somewhere
* further down in the document.
*/
// mimic docx4j 2.7.0 and earlier behaviour; this will
// drop w14:glow etc; the preprocessor doesn't need to
// do that
eventHandler.setContinue(true);
// There is no JAXBResult(binder),
// so use a
DOMResult result = new DOMResult();