抱歉我的英文。 我的XSD文件的片段:
<!--ru-RU: Группа настроек-->
<!--en-US: Settings group-->
<xs:complexType name="settingsGroup" >
<xs:sequence>
<xs:element name="string" type="stringValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="bool" type="boolValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="date" type="dateValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="dateTime" type="dateTimeValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="int" type="intValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="double" type="doubleValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="day" type="dayValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="month" type="monthValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="year" type="yearValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="localization" type="languageValue" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="nameId" type="xs:ID" use="required"/>
</xs:complexType>
我需要更改'settingsGroup'类型,以便它可以获取'settingsGroup'类型的集合,或者我在上面的方案中指定的内容...如何在XSD文件中编写OR逻辑?
喜欢它的东西:
<!--ru-RU: Группа настроек-->
<!--en-US: Settings group-->
<xs:complexType name="settingsGroup" >
<!--en-US: Something like it:-->
<xs:or>
<xs:sequence>
<xs:element name="group" type="settingsGroup" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:sequence>
<xs:element name="string" type="stringValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="bool" type="boolValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="date" type="dateValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="dateTime" type="dateTimeValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="int" type="intValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="double" type="doubleValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="day" type="dayValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="month" type="monthValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="year" type="yearValue" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="localization" type="languageValue" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:or>
<xs:attribute name="nameId" type="xs:ID" use="required"/>
</xs:complexType>
此致
答案 0 :(得分:1)
其<xs:choice>
..
用它代替<xs:or>