- Need to define XSD element that has some attributes and can hold list of itself
This is the type definition:
<xs:complexType name="t_TestCase" >
<xs:sequence>
<xs:element type="t_TestCase" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
This is t开发者_运维问答he element based on the type:
- BUT - when adding attribute to the type - it seems that it is not valid anymore. (the sequence tag is invalid)
Advise please?
Tx
Use a complex type like so:
<xs:element name="t_TestCase">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="t_TestCase"/>
</xs:sequence>
<xs:attribute name="att1"/>
</xs:complexType>
</xs:element>
Edit: my first answer sucked
精彩评论