Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xsd 模式的模式_Xsd - Fatal编程技术网

Xsd 模式的模式

Xsd 模式的模式,xsd,Xsd,是否可以使用xml模式来表示其他模式的somme规则 我读过,这很有趣,但我想验证一些应用规则;例如,在模式中,xs:schema元素是否有版本号?xs:attribute元素是否有use属性?等等 这方面有什么好的做法吗 谢谢。这是一个几乎完美的应用程序。我不能给你一个完整的schematron来测试这类规则,但你会看到这样的东西: <pattern id="attribute-checks"> <rule context="xs:attribute">

是否可以使用xml模式来表示其他模式的somme规则

我读过,这很有趣,但我想验证一些应用规则;例如,在模式中,
xs:schema
元素是否有版本号?
xs:attribute
元素是否有use属性?等等

这方面有什么好的做法吗


谢谢。

这是一个几乎完美的应用程序。我不能给你一个完整的schematron来测试这类规则,但你会看到这样的东西:

<pattern id="attribute-checks">
    <rule context="xs:attribute">
        <assert test="@use">All xs:attribute elements must have a use attribute</assert>
    </rule>
</pattern>

所有xs:attribute元素都必须具有use属性

Schematron允许您为任何xml文件(显然包括模式)表达超出简单语法规则的规则驱动。您可以使用它们将验证扩展到业务规则级别。

不幸的是,我不能将schematron与我使用的linux命令
xmllint
一起使用。无论如何,感谢您的帮助。不,您还需要类似于
xsltproc
的东西-schematron是用XSLT实现的。如果您使用的是
xmllint
,那么您应该也能够使用
xsltproc
,我希望:)