命令行验证器,支持使用嵌入式iso Schematron放松Schemas [英] command line validator supporting relax ng Schemas with embedded iso Schematron

查看:63
本文介绍了命令行验证器,支持使用嵌入式iso Schematron放松Schemas的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可以使用嵌入式iso schematron处理松弛ng-Schema的命令行验证器?

Are there any command line-validators that can cope with relax ng-Schemas with embedded iso schematron?

我有一些带有嵌入式等电调子规则的松弛ng方案,必须在命令行上进行验证.看起来,我们通常的验证器jing仅适用于schematron 1.5.在网上冲浪时,我找不到支持嵌入式iso schematron的任何验证器,但我使用oXygen作为xml编辑器,因此可以从那里进行验证.

I've got a couple of relax ng-schemas with embedded iso-schematron rules which I have to be able to validate on the command line. As it seems, jing, our usual validator, only works with schematron 1.5. Surfing the web, I haven't been able to find any validator supporting embedded iso schematron but I use oXygen as an xml editor and I can validate just fine from there.

推荐答案

只要首先提取Schematron规则,然后对提取的Schematron模式运行单独的验证,就可以使用Jing. RNG2Schtrn.xsl XSLT样式表可以进行Schematron提取(在网上很难找到,但是我们在

You can use Jing, as long as you first extract the Schematron rules, and then run a separate validation against the extracted Schematron schema. Schematron extraction is possible with the RNG2Schtrn.xsl XSLT style sheet (it's a bit hard to find online, but we have a copy at https://github.com/citation-style-language/utilities/blob/master/RNG2Schtrn.xsl) and Saxon (which is bundled along with Jing). If your schema is in the compact .rnc syntax, you first have to convert it to the XML .rng syntax, for which you can use Trang.

摘录自 https://github. com/citation-style-language/utilities/blob/master/style-qc.sh

# Jing currently ignores embedded Schematron rules.
# For this reason, the schema is first converted to
# RELAX NG XML, after which the Schematron code is
# extracted and tested separately.
java -jar ${pathTrang} ${pathCSLSchema} ${TMP_DIR}/csl.rng
java -jar ${pathSaxon} -o ${TMP_DIR}/csl.sch ${TMP_DIR}/csl.rng RNG2Schtrn.xsl
java -jar ${pathJing} ${TMP_DIR}/csl.sch ${pathCSLStyles}/*.csl || true

# RELAX NG Compact validation
java -jar ${pathJing} -c ${pathCSLSchema} ${pathCSLStyles}/*.csl || true

另请参见 https://stackoverflow.com/a/18616036/1712389

这篇关于命令行验证器,支持使用嵌入式iso Schematron放松Schemas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆