command line validator supporting relax ng Schemas with embedded iso Schematron

∥☆過路亽.° 提交于 2019-12-02 02:57:12
Rintze Zelle

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.

And excerpt from 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

See also https://stackoverflow.com/a/18616036/1712389

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!