I have an XML schema with my "video" element and the "youtube" element inside:
<xs:element name="video"> <xs:complexType> <xs:sequence> <xs:element ref="youtube" minOccurs="0" maxOccurs="1"/> </xs:sequence> <xs:attribute name="file" type="xs:string"/> </xs:complexType> </xs:element>
and I want to add another param element to the existing video types:
<xs:element name="param"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> </xs:element>
I would have a param element inside the youtube.
Limitations:
- youtube can only happen once in my xml
- param - can occur many times in my xml
like this:
<video> <youtube file = "aaa"/> <param name="a1" value"b1"/> <param name="a2" value"b2"/> </video>
How to keep these restrictions in this scheme?
If I do something like this:
<xs:sequence> <xs:element ref="youtube" minOccurs="0" maxOccurs="1"/> <xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence>
if the sequence is specified as follows:
<xs:sequence> <xs:element ref="youtube" minOccurs="0" maxOccurs="1"/> <xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence>
it determines what the parameter should be after youtube - but I do not want to specify the sequence
UGEEN source share