public void setXMLSchema(URL url) throws XMLPlatformException { if (null == url) { return; } try { documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA); documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString()); } catch (IllegalArgumentException e) { // The attribute isn't supported so do nothing } catch (Exception e) { XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e); } }
public void setXMLSchema(URL url) throws XMLPlatformException { if (null == url) { return; } try { documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA); documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString()); } catch (IllegalArgumentException e) { // The attribute isn't supported so do nothing } catch (Exception e) { XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e); } }
public void setXMLSchema(URL url) throws XMLPlatformException { if (null == url) { return; } try { documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA); documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString()); } catch (IllegalArgumentException e) { // The attribute isn't supported so do nothing } catch (Exception e) { XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e); } }
/** * Sets XML Schema for the parser. * * @param url url of the XMLSchema * @throws XMLPlatformException exception occurred while setting XMLSchema */ public void setXMLSchema(URL url) throws XMLPlatformException { if (null == url) { return; } if (null == documentBuilderFactory) { loadDocumentBuilderFactory(); } try { documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA); documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString()); } catch (IllegalArgumentException e) { // The attribute isn't supported so do nothing } catch (Exception e) { XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e); } }
/** * Sets XML Schema for the parser. * * @param url url of the XMLSchema * @throws XMLPlatformException exception occurred while setting XMLSchema */ @Override public void setXMLSchema(URL url) throws XMLPlatformException { if (null == url) { return; } if (null == documentBuilderFactory) { loadDocumentBuilderFactory(); } try { documentBuilderFactory.setAttribute(SCHEMA_LANGUAGE, XML_SCHEMA); documentBuilderFactory.setAttribute(JAXP_SCHEMA_SOURCE, url.toString()); } catch (IllegalArgumentException e) { // The attribute isn't supported so do nothing } catch (Exception e) { XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(url, e); } }
@Override public boolean validateDocument(Document document, URL xmlSchemaURL, ErrorHandler errorHandler) throws XMLPlatformException { Schema xmlSchema; try { xmlSchema = getSchemaFactory().newSchema(xmlSchemaURL); } catch(SAXException e) { throw XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(xmlSchemaURL, e); } try { Validator validator = xmlSchema.newValidator(); validator.setErrorHandler(errorHandler); validator.validate(new DOMSource(document)); } catch(Exception e) { throw XMLPlatformException.xmlPlatformValidationException(e); } return true; }
public boolean validateDocument(Document document, URL xmlSchemaURL, ErrorHandler errorHandler) throws XMLPlatformException { Schema xmlSchema; try { xmlSchema = getSchemaFactory().newSchema(xmlSchemaURL); } catch(SAXException e) { throw XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(xmlSchemaURL, e); } try { Validator validator = xmlSchema.newValidator(); validator.setErrorHandler(errorHandler); validator.validate(new DOMSource(document)); } catch(Exception e) { throw XMLPlatformException.xmlPlatformValidationException(e); } return true; }
public boolean validateDocument(Document document, URL xmlSchemaURL, ErrorHandler errorHandler) throws XMLPlatformException { Schema xmlSchema; try { xmlSchema = getSchemaFactory().newSchema(xmlSchemaURL); } catch(SAXException e) { throw XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(xmlSchemaURL, e); } try { Validator validator = xmlSchema.newValidator(); validator.setErrorHandler(errorHandler); validator.validate(new DOMSource(document)); } catch(Exception e) { throw XMLPlatformException.xmlPlatformValidationException(e); } return true; }
validator = new XSDValidator(); } catch (Exception e) { throw XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(xmlSchemaURL, e);
validator = new XSDValidator(); } catch (Exception e) { throw XMLPlatformException.xmlPlatformErrorResolvingXMLSchema(xmlSchemaURL, e);