问题描述
由于XML模式(XSD)本身就是XML文件,因此应该可以构建模式(元模式)的模式,对吧?
Since XML schemata (XSD) are themselves XML files, it should be possible to builda schema of a schema (meta-schema), right?
我正在努力实现这一壮举.
I'm struggling to accomplish that feat.
我想创建一个描述模式的模式一个根complexType
包含一个simpleTypes
序列.
I would like to create a schema that describes a schemawith one root complexType
containing a sequence of simpleTypes
.
推荐答案
Akoma-Ntoso是这种元模式的一个示例:
Akoma-Ntoso is an example of such a meta-schema:
Akoma Ntoso(西非阿坎语中的相联之心")定义了一套简单的,与技术无关的电子表示形式的XML格式的议会,立法和司法文件.
Akoma Ntoso ("linked hearts" in the Akan language of West Africa) defines a set of simple technology-neutral electronic representations in XML format of parliamentary, legislative and judiciary documents.
它使用两个抽象extends
:
- 扩展是派生的规则,它以受控方式添加了新功能遵守基本规则,以便根据可以通过删除基本规则来验证派生规则附加的功能.根据得出的有效文件集规则是根据基本规则.
- an extension is a derived rule that adds in a controlled way new featuresto a base rule, so that all documents that are correct according to thederived rule can be validated against the base rule by removing theadditional features. The set of valid documents according to the derivedrule is a controlled superset of the set of valid documents according to thebase rule.
- 限制是比基本限制严格的派生规则,因此所有根据派生规则正确的文档也有效根据基数:派生规则的有效文档集是根据基本规则.
- a restriction is a derived rule that is stricter than the base one, so that alldocuments that are correct according to the derived rule are also validaccording to the base one: the set of valid documents for the derived ruleis a mathematical subset of the set of valid documents according to thebase rule.
和restricts
:
参考
定制Akoma Ntoso-博洛尼亚大学法比奥·维塔利大学教授(pdf)
系统生物学标记语言(SBML):语言规范适用于3级版本1核心
这篇关于XML元架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!