How do I declare in this case the "coverimage" attribute of the element "book" in the XSD file? I would also like to restrict the "currency" attribute to the following currencies: dollars, euros, pounds with enumeration, by giving a type (xs:simpleType) definition. How do I do that?
Here is my XML:
<book coverimage="#">
<title>Who cares</title>
<autor>Doesn't Matter</autor>
<price currency="euros">14.99</price>
<year>1987</year>
</book>
Here is my XSD:
<xs:element name="book" minOccurs="0" maxOccurs="unbounded">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="autor" type="xs:string"/>
<xs:element name="price">
<xs:complexType>
<xs:attribute name="currency" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="year" type="xs:integer"/>