本文整理汇总了Java中org.apache.xerces.parsers.StandardParserConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java StandardParserConfiguration类的具体用法?Java StandardParserConfiguration怎么用?Java StandardParserConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StandardParserConfiguration类属于org.apache.xerces.parsers包,在下文中一共展示了StandardParserConfiguration类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: runSchema
点赞 3
import org.apache.xerces.parsers.StandardParserConfiguration; //导入依赖的package包/类
public int runSchema() {
StandardParserConfiguration config = new StandardParserConfiguration();
config.setProperty(
"http://java.sun.org/xml/jaxp/properties/schemaSource", new File(
xmlSchema));
config.setFeature(
"http://apache.org/xml/features/validation/schema-full-checking",
true);
config.setFeature("http://apache.org/xml/features/validation/schema",
true);
config.setFeature("http://xml.org/sax/features/validation", true);
TerminateOnErrorHandler errorCollector = new TerminateOnErrorHandler();
try {
SAXParser parser = new SAXParser(config);
parser.setErrorHandler(errorCollector);
parser.parse(new File(xmlDoc).getAbsolutePath());
System.err.println("XersesSchemaRun: no errors reported");
return Result.PASS;
} catch (Exception e) {
System.err.println("XersesSchemaRun: unexpected exception " + e);
e.printStackTrace(System.err);
return Result.FAIL;
}
}
开发者ID:freeVM,
项目名称:freeVM,
代码行数:25,
代码来源:XersesSchemaRun.java
示例2: Xerces
点赞 2
import org.apache.xerces.parsers.StandardParserConfiguration; //导入依赖的package包/类
private Xerces(String schemaProperty, String schemaDescriptor) throws SAXNotRecognizedException, SAXNotSupportedException{
this.domp = new DOMParser(new StandardParserConfiguration());
domp.setFeature("http://xml.org/sax/features/validation", true);
domp.setFeature("http://apache.org/xml/features/validation/schema",
true);
domp.setFeature(
"http://apache.org/xml/features/validation/schema-full-checking",
true);
// domp.setFeature("http://apache.org/xml/features/xinclude", true);
domp.setFeature(
"http://apache.org/xml/features/honour-all-schemaLocations",
true);
domp.setProperty(schemaProperty, schemaDescriptor);
domp.setErrorHandler(this.handler);
}
开发者ID:nkutsche,
项目名称:opendocs,
代码行数:16,
代码来源:Xerces.java
示例3: createReader
点赞 2
import org.apache.xerces.parsers.StandardParserConfiguration; //导入依赖的package包/类
protected XMLPullParserConfiguration createReader(Ruby ruby, Options options) {
StandardParserConfiguration config = new StandardParserConfiguration();
DocumentHandler handler = new DocumentHandler(ruby);
// XMLReader reader = XMLReaderFactory.createXMLReader();
config.setDocumentHandler(handler);
config.setDTDHandler(handler);
config.setErrorHandler(handler);
config.setEntityResolver(new EntityResolver2Wrapper(new NokogiriEntityResolver(ruby, null, options)));
// config.setFeature("http://xml.org/sax/features/xmlns-uris", true);
// config.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
config.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", options.dtdLoad || options.dtdValid);
return config;
}
开发者ID:gocd,
项目名称:gocd,
代码行数:14,
代码来源:XmlReader.java