if (schemaURLDeque != null && schemaURLDeque.size() != 0)
{
SymbolTable symbolTable = new SymbolTable(SYMBOL_TABLE_SIZE);
XMLGrammarPreparser preparser = new XMLGrammarPreparser(symbolTable);
XMLGrammarPoolImpl grammarPool = new XMLGrammarPoolImpl();
preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
preparser.setGrammarPool(grammarPool);
preparser.setProperty(BUFFER_SIZE_PROPERTY, BUFFER_SIZE);
preparser.setFeature(NAMESPACES_FEATURE, true);
preparser.setFeature(VALIDATION_FEATURE, true);
preparser.setFeature(SCHEMA_VALIDATION_FEATURE, true);
preparser.setFeature(NODE_DEFERRAL_FEATURE, false);
preparser.setErrorHandler(ERROR_HANDLER);
preparser.setEntityResolver(new MappedResolver(schemaURLDeque));
for (Iterator itr = schemaURLDeque.valueIterator(); itr.hasNext(); )
{
URL xsdURL = (URL)itr.next();
InputStream istream = URLUtil.openStream(xsdURL);
try
{
preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
new XMLInputSource(null, xsdURL.toExternalForm(), null, istream, ENCODING));
}
finally
{
IOUtil.close(istream);
}
}
grammarPool.lockPool();
cfg = new IntegratedParserConfiguration(symbolTable, grammarPool);
cfg.setFeature(VALIDATION_FEATURE, true);
cfg.setFeature(SCHEMA_VALIDATION_FEATURE, true);
}
else