私はいつも考えていたように、xs:restriction
は特定のsimpleTypeまたはcomplexTypeを制限するために使用されます。したがって、名前はrestriction
です。しかし、以下のxsdスニペットは正しいです。 Norwegian_customer
を見てください。country
はcomplexTypeで上書きされているので、拡張されています。そして名前が変更されました。 xs:restriction
は何を提供したいですか? xs:restriction
は、xs:extension
のスーパーセットですか?スニペットの有効性はWebStorm
です。なぜこのcomplexType定義が正しいのですか
<xs:complexType name="customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Norwegian_customer">
<xs:complexContent>
<xs:restriction base="customer">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="country1">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>