我在哪里可以找到ISO Schematron验证器的Java实现?

编程入门 行业动态 更新时间:2024-10-15 18:22:58
本文介绍了我在哪里可以找到ISO Schematron验证器的Java实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

ISO Schematron标准已经出现两年了,但我仍然无法使用ISO Schematron XSLT文件找到Java实现(而不是旧版Schematron中的文件,例如: uploading/files/c9c9cb87/SchematronXpath.jar/ )。

The ISO Schematron standard has been out for two years now, but I'm still unable to find a Java implementation using ISO Schematron XSLT files (as opposed to files from an older version of Schematron, e.g. here: uploading/files/c9c9cb87/SchematronXpath.jar/).

有没有人知道可以从Java方法轻松调用的生产就绪ISO模式验证器?

Does anyone know of a production-ready ISO schema validator that can be easily called from a Java method?

推荐答案

此外,您可以使用 ph-schematron ,它既提供对转换到XSLT的支持,也提供本机普通Java验证,这比XSLT更快几乎在所有情况下的版本。 有关详细信息,请参见 github/phax/ph-schematron/ 快速介绍。 检查XML文件是否与Schematron文件匹配的示例代码:

Additionally you may use ph-schematron which provides both support for conversion to XSLT as well as a native plain Java validation, which is quicker than the XSLT version in nearly all cases. See github/phax/ph-schematron/ for the details as well as a quick intro. Example code to check if an XML file matches a Schematron file:

public static boolean validateXMLViaPureSchematron (File aSchematronFile, File aXMLFile) throws Exception { final ISchematronResource aResPure = SchematronResourcePure.fromFile (aSchematronFile); if (!aResPure.isValidSchematron ()) throw new IllegalArgumentException ("Invalid Schematron!"); return aResPure.getSchematronValidity(new StreamSource(aXMLFile)).isValid (); }

更多推荐

我在哪里可以找到ISO Schematron验证器的Java实现?

本文发布于:2023-11-29 11:15:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646242.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我在   可以找到   ISO   Schematron   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!