org.apache.xerces.parsers.XMLGrammarPreparser.setErrorHandler()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.xerces.parsers.XMLGrammarPreparser.setErrorHandler()方法的一些代码示例,展示了XMLGrammarPreparser.setErrorHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLGrammarPreparser.setErrorHandler()方法的具体详情如下:
包路径:org.apache.xerces.parsers.XMLGrammarPreparser
类名称:XMLGrammarPreparser
方法名:setErrorHandler

XMLGrammarPreparser.setErrorHandler介绍

[英]Sets the error handler.
[中]设置错误处理程序。

代码示例

代码示例来源:origin: org.opengis.cite/cite1-utils

public static Grammar parseGrammar(String baseUri, Reader in,
    XMLGrammarPool grammarPool, XMLErrorHandler errorHandler)
    throws IOException {
  String encoding = null;
  XMLGrammarPreparser grammerParser = getGrammarParser();
  if (grammarPool != null) {
    grammerParser.setGrammarPool(grammarPool);
  }
  if (errorHandler != null) {
    grammerParser.setErrorHandler(errorHandler);
  }
  grammerParser.setEntityResolver(getXmlEntityResolver(encoding));
  return grammerParser.preparseGrammar(
      "http://www.w3.org/2001/XMLSchema", new XMLInputSource(baseUri,
          baseUri, baseUri, in, encoding));
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

public static WSDLValidationInfo validate(XMLInputSource xmlInputSource) throws Exception {
  XMLGrammarPreparser preparser = new XMLGrammarPreparser();
  preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
  preparser.setFeature(NAMESPACES_FEATURE_ID, true);
  preparser.setFeature(VALIDATION_FEATURE_ID, true);
  preparser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, true);
  WSDLValidationInfo validationInfo = new WSDLValidationInfo();
  preparser.setErrorHandler(new ErrorHandler(validationInfo));
  preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, xmlInputSource);
  return validationInfo;
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

grammarPreparser.setGrammarPool(grammarPool);
grammarPreparser.setErrorHandler(errorHandler);
if (entityResolver != null)

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

grammarPreparser.setGrammarPool(grammarPool);
grammarPreparser.setErrorHandler(errorHandler);
if (entityResolver != null)

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

grammarPreparser.setErrorHandler(errorHandler);
if (entityResolver != null)

代码示例来源:origin: com.thaiopensource/jing

ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
SAXXMLErrorHandler xeh = new SAXXMLErrorHandler(eh);
preparser.setErrorHandler(xeh);
EntityResolver er = properties.get(ValidateProperty.ENTITY_RESOLVER);
if (er != null)

代码示例来源:origin: org.daisy.libs/jing

ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
SAXXMLErrorHandler xeh = new SAXXMLErrorHandler(eh);
preparser.setErrorHandler(xeh);
EntityResolver er = properties.get(ValidateProperty.ENTITY_RESOLVER);
if (er != null)

相关文章