本文整理了Java中org.apache.xerces.impl.xs.XMLSchemaLoader.setEntityResolver()
方法的一些代码示例,展示了XMLSchemaLoader.setEntityResolver()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLSchemaLoader.setEntityResolver()
方法的具体详情如下:
包路径:org.apache.xerces.impl.xs.XMLSchemaLoader
类名称:XMLSchemaLoader
方法名:setEntityResolver
[英]Sets the entity resolver.
[中]设置实体解析程序。
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
public void setResourceResolver(LSResourceResolver resourceResolver) {
fLSResourceResolver = resourceResolver;
fDOMEntityResolverWrapper.setEntityResolver(resourceResolver);
fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
}
代码示例来源:origin: org.wso2.bpel/ode-utils
XMLSchemaLoader schemaLoader = new XMLSchemaLoader();
InternalSchemaResolver resolver = new InternalSchemaResolver();
schemaLoader.setEntityResolver(resolver);
schemaLoader.setParameter(Constants.DOM_ERROR_HANDLER, new SchemaErrorHandler());
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
/**
* Get an instance of XSLoader that is capable of
* parsing schema files
* @param xeh XML Error handler
* @param xer XML Entity Resolver
* @return
*/
public XSLoader getXSLoader(XMLErrorHandler xeh, XMLEntityResolver xer)
{
XMLSchemaLoader xsloader = new XMLSchemaLoader();
xsloader.setEntityResolver(xer);
xsloader.setErrorHandler(xeh);
xsloader.setProperty("http://apache.org/xml/properties/internal/grammar-pool", new XMLGrammarPoolImpl());
return xsloader;
}
代码示例来源:origin: org.wso2.bpel/ode-utils
schemaLoader.setEntityResolver(cr);
schemaLoader.setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true);
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
BaseSchemaFactory(String xsdVersion) {
fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
fDOMEntityResolverWrapper = new DOMEntityResolverWrapper();
fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
fXMLSchemaLoader.setProperty(XML_SCHEMA_VERSION, xsdVersion);
fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
fXSDVersion = xsdVersion;
fUseGrammarPoolOnly = true;
}
代码示例来源:origin: elodina/xml-avro
public Schema createSchema(LSInput input) {
ErrorHandler errorHandler = new ErrorHandler();
XMLSchemaLoader loader = new XMLSchemaLoader();
if (resolver != null)
loader.setEntityResolver(new EntityResolver(resolver));
loader.setErrorHandler(errorHandler);
loader.setParameter(Constants.DOM_ERROR_HANDLER, errorHandler);
XSModel model = loader.load(input);
errorHandler.throwExceptionIfHasError();
return createSchema(model);
}
代码示例来源:origin: deegree/deegree3
schemaLoader.setEntityResolver( new RedirectingEntityResolver() );
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
try {
fResourceResolver = new DOMEntityResolverWrapper((LSResourceResolver) value);
setEntityResolver(fResourceResolver);
代码示例来源:origin: deegree/deegree3
schemaUrls[i] = resolver.redirect( schemaUrls[i] );
schemaLoader.setEntityResolver( resolver );
代码示例来源:origin: deegree/deegree3
schemaLoader.setEntityResolver( resolver );
代码示例来源:origin: com.rackspace.apache/xerces2-xsd11
SchemaGrammar parseXMLSchema(XMLInputSource is)
throws IOException {
XMLEntityResolver resolver = getEntityResolver();
if(resolver != null) {
fSchemaLoader.setEntityResolver(resolver);
}
if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
}
fSchemaLoader.setProperty(ERROR_REPORTER, fErrorReporter);
String propPrefix = Constants.XERCES_PROPERTY_PREFIX;
String propName = propPrefix + Constants.SCHEMA_LOCATION;
fSchemaLoader.setProperty(propName, getProperty(propName));
propName = propPrefix + Constants.SCHEMA_NONS_LOCATION;
fSchemaLoader.setProperty(propName, getProperty(propName));
propName = Constants.JAXP_PROPERTY_PREFIX+Constants.SCHEMA_SOURCE;
fSchemaLoader.setProperty(propName, getProperty(propName));
fSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, getFeature(SCHEMA_FULL_CHECKING));
// Should check whether the grammar with this namespace is already in
// the grammar resolver. But since we don't know the target namespace
// of the document here, we leave such check to XSDHandler
SchemaGrammar grammar = (SchemaGrammar)fSchemaLoader.loadGrammar(is);
// by default, hand it off to the grammar pool
if (grammar != null) {
fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA,
new Grammar[]{grammar});
}
return grammar;
} // parseXMLSchema(XMLInputSource) : SchemaGrammar
内容来源于网络,如有侵权,请联系作者删除!