2017-05-27 104 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