builder = new XMPDocumentBuilder();
builder.addPreprocessor(new PDFAExtentionSchemaPreprocessor());
} catch (XmpSchemaException e1) {
throw new ValidationException(e1.getMessage(), e1);
}
XMPMetadata metadata;
try {
metadata = builder.parse(tmp);
handler.setMetadata(metadata);
} catch (XmpSchemaException e) {
throw new ValidationException(
"Parser: Internal Problem (failed to instanciate Schema object)", e);
} catch (XmpXpacketEndException e) {
throw new ValidationException("Unable to parse font metadata due to : "
+ e.getMessage(), e);
}
List<ValidationError> lve = new ArrayList<ValidationError>();
// 6.7.5 no deprecated attribute in xpacket processing instruction
if (metadata.getXpacketBytes() != null) {
lve.add(new ValidationError(
ValidationConstants.ERROR_METADATA_XPACKET_DEPRECATED,
"bytes attribute is forbidden"));
}
if (metadata.getXpacketEncoding() != null) {
lve.add(new ValidationError(
ValidationConstants.ERROR_METADATA_XPACKET_DEPRECATED,
"encoding attribute is forbidden"));
}