我試圖通過XSLT文件(iso_svrl_for_xslt2.xsl)在Saxon9HE的幫助下編譯Schematron文件,如here和there所述。Saxon從Schematron生成空的XML
在這裏,我呼籲撒克遜與3個參數:
-o:架構compiled.xsl是輸出文件(XSLT腳本)
-s:example_schematron.xsl是源文件
異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>
架構compiled.xsl:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
爲什麼我會收到空模式,compiled.xsl?
非常感謝!它終於奏效了。你是對的,我的文件中的命名空間已經過時了,因爲它在這裏說明了[鏈接](http://www.schematron.com/resources.html)。但我讀錯了,並認爲這是另一種方式:'http:// purl.oclc.org/dsdl/schematron'不得不改爲'http:// www.ascc.net/xml/schematron'。傻我。 – Jugo