Search in sources :

Example 1 with IgnoreSchemaErrorsErrorHandler

use of nokogiri.internals.IgnoreSchemaErrorsErrorHandler in project gocd by gocd.

the class XmlSchema method getSchema.

private Schema getSchema(Source source, String currentDir, String scriptFileName) throws SAXException {
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    SchemaResourceResolver resourceResolver = new SchemaResourceResolver(currentDir, scriptFileName, null);
    schemaFactory.setResourceResolver(resourceResolver);
    schemaFactory.setErrorHandler(new IgnoreSchemaErrorsErrorHandler());
    return schemaFactory.newSchema(source);
}
Also used : SchemaFactory(javax.xml.validation.SchemaFactory) IgnoreSchemaErrorsErrorHandler(nokogiri.internals.IgnoreSchemaErrorsErrorHandler)

Example 2 with IgnoreSchemaErrorsErrorHandler

use of nokogiri.internals.IgnoreSchemaErrorsErrorHandler in project nokogiri by sparklemotion.

the class XmlSchema method getSchema.

private Schema getSchema(Source source, String currentDir, String scriptFileName) throws SAXException {
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    SchemaResourceResolver resourceResolver = new SchemaResourceResolver(currentDir, scriptFileName, null);
    schemaFactory.setResourceResolver(resourceResolver);
    schemaFactory.setErrorHandler(new IgnoreSchemaErrorsErrorHandler());
    return schemaFactory.newSchema(source);
}
Also used : SchemaFactory(javax.xml.validation.SchemaFactory) IgnoreSchemaErrorsErrorHandler(nokogiri.internals.IgnoreSchemaErrorsErrorHandler)

Aggregations

SchemaFactory (javax.xml.validation.SchemaFactory)2 IgnoreSchemaErrorsErrorHandler (nokogiri.internals.IgnoreSchemaErrorsErrorHandler)2