首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Saxon从Schematron生成空XML

Saxon从Schematron生成空XML
EN

Stack Overflow用户
提问于 2013-06-05 14:44:40
回答 1查看 1K关注 0票数 0

我正试图通过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脚本。

代码语言:javascript
复制
java -jar saxon9he.jar -o:schema-compiled.xsl -s:example_schematron.sch iso-schematron-xslt2/iso_svrl_for_xslt2.xsl

以下是这些文件:

example_schematron.sch:

代码语言:javascript
复制
<?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-编译程序.:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

为什么我得到的是空模式-编译. Why?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-05 14:51:50

我还没有看过样式表,但是我认为(基于http://www.schematron.com/iso/iso-schematron.rnc.txthttp://en.wikipedia.org/wiki/Schematron#Versions) ISO语言在名称空间http://purl.oclc.org/dsdl/schematron中定义了它的元素,而您的文件使用了不同的名称空间。因此,您可能需要调整您的模式以使用ISO命名空间,或者您需要为您的模式使用与ISO样式表不同的样式表。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16942939

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档