I want to do something totally simple and obvious, but i can't find any example about it on internet. All the examples i found always involve a single attribute.
I want to create an element like this :
I have the following XSD, but i'm getting an error saying that the resitriction element is misplaced or appears too often :
<xs:element name="blabla">
<xs:complexType>
<xs:sequence>
<xs:element name="Images" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="image" type="imageType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="imageType">
<xs:sequence>
<xs:element name="Image" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:integer">
<xs:attribute name="id" type="xs:integer" use="required" />
</xs:restriction>
<xs:restriction base="xs:string">
<xs:attribute name="src" type="xs:anyURI" use="required" />
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
How can i add a different restriction for each attribute ? Thnaks.
No comments:
Post a Comment