xsdの要素宣言で一意のタグを直接使用する方法の例を見てきましたが、複合型である要素宣言に入れる方法を理解できません。以下のコードを参照してください。
<xs:complexType name="flighttype">
<xs:sequence>
<xs:element name="departure" type="departuretype"/>
<xs:element name="arrival" type="arrivaltype"/>
<xs:element name="altitude" type="xs:string"/>
<xs:element name="speed" type="xs:string"/>
<xs:element name="distance" type="xs:string"/>
<xs:element name="entertainment" type="entertainmenttype"/>
<xs:element name="safetymessage" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="airline" type="xs:string"/>
<xs:attribute name="flightno" type="xs:string"/>
<xs:attribute name="model" type="xs:string"/>
<xs:attribute name="passengers" type="xs:integer"/>
<xs:attribute name="status" type="xs:string"/>
</xs:complexType>
IDを一意のIDにしたいので、次の例を機能させることができますが、要素宣言内で直接使用されます。
ありがとうございました!