我实际上正在尝试根据 Java 中的 schematron 文件来验证 xml 文件。我有以下声明:
SchemaFactory factory = SchemaFactory.newInstance("http://www.ascc.net/xml/schematron");
但是当我运行该程序时,我收到此错误:
Exception in thread "main" java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.ascc.net/xml/schematron could be loaded
有人可以帮忙吗? 谢谢。
最佳答案
或者您可以使用https://github.com/phax/ph-schematron/用于根据 SCH 文件验证 XML。它提供“纯”验证以及基于 XSLT 的验证。
关于java - Schematron 的 Uri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26662945/