}
public boolean isValid(Document document, ErrorHandler errorHandler) {
try {
XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
return xmlPlatform.validateDocument(document, getURL(), errorHandler);
} catch (XMLPlatformException e) {
if (e.getErrorCode() == XMLPlatformException.XML_PLATFORM_PARSER_ERROR_RESOLVING_XML_SCHEMA) {
throw XMLMarshalException.errorResolvingXMLSchema(e);
} else {
return false;