我正试图通过XSLT文件(iso_svrl_for_xslt2.xsl)编译Schematron文件,并借助Saxon9HE (如这里和那里所描述的)。
在这里,我用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-编译程序.:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>为什么我得到的是空模式-编译. Why?
发布于 2013-06-05 14:51:50
我还没有看过样式表,但是我认为(基于http://www.schematron.com/iso/iso-schematron.rnc.txt和http://en.wikipedia.org/wiki/Schematron#Versions) ISO语言在名称空间http://purl.oclc.org/dsdl/schematron中定义了它的元素,而您的文件使用了不同的名称空间。因此,您可能需要调整您的模式以使用ISO命名空间,或者您需要为您的模式使用与ISO样式表不同的样式表。
https://stackoverflow.com/questions/16942939
复制相似问题