【发布时间】:2013-06-05 14:44:40
【问题描述】:
我正在尝试在 Saxon9HE 的帮助下通过 XSLT 文件 (iso_svrl_for_xslt2.xsl) 编译 Schematron 文件,如 here 和 there 所述。
这里我用 3 个参数调用 Saxon:
-o:schema-compiled.xsl 是输出文件(XSLT 脚本)
-s:example_schematron.xsl是源文件
iso-schematron-xslt2/iso_svrl_for_xslt2.xsl是样式表文件,用于将schematron文件编译成XSLT脚本
java -jar saxon9he.jar -o:schema-compiled.xsl -s:example_schematron.sch iso-schematron-xslt2/iso_svrl_for_xslt2.xsl
这里是文件:
example_schematron.sch:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.ascc.net/xml/schematron">
<title>Test Schematron</title>
<pattern name="My rules">
<rule context="User">
<assert test="count(email) != 1">
User shall have exactly one email
</assert>
</rule>
</pattern>
</schema>
schema-compiled.xsl:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
为什么我得到空的 schema-compiled.xsl?
【问题讨论】:
标签: xml xslt saxon schematron