2017-05-27 83 views
2
<schema xmlns="http://www.w3.org/2001/XMLSchema" ... version="xxx"> 

的XSD规范https://www.w3.org/TR/xmlschema11-1/#declare-schema不指定version属性的语义:XSD“版本”属性语义

其它属性(idversion)是用于用户的便利性,并且本说明书中没有定义它们的语义。

也不是W3C版本控制指南https://www.w3.org/TR/xmlschema-guide2versioning/

有没有出现这个属性是否应该使用指定的XML Schema文档(如2.3.1)的版本达成共识,或用来编写模式文档的XSD语言的版本(即无论是1.01.1) ?还是在设计师/开发人员的语义选择上呢?

回答

3

xs:schema/@version属性用于指定正在开发的XSD版本,而不是XSD 1.0 vs 1.1。可以使用Semantic versioning或任何其他用户定义的语义。正如你的报价表明的那样,由用户来定义。

要指定XSD 1.0和1.1,XSD 1.1提供了conditional inclusion,它可用于任何XSD元素,包括xsd:schema根元素。例如,需要声明的XSD可能表明这样需要XSD 1.1:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" 
      vc:minVersion="1.1"> 
    <!-- --> 
</xs:schema> 
+0

这是我想太多,但是当我在网络上搜索,我发现几个环节如[这一个]( http://wiki.archive.iatistandard.org/standard/revision/1.03/changes_specification#add_a_schema_version_attribute_to_the_root_element),但没有明确支持我的观点。这导致我问这个问题。 – xarx

+0

[link](http://wiki.archive.iatistandard.org/standard/revision/1.03/changes_specification#add_a_schema_version_attribute_to_the_root_element)也支持你的观点。他们推荐使用'xs:schema/@ version'的*标准*是指它们的[** IATI标准**](http://wiki.archive.iatistandard.org/standard/start),* not *遵循W3C XML Schema标准。 – kjhughes