I'm trying to use a list of enums, but limit the values to only one occurrence of each value. Let's say I have a enum that represents books in a library.
<xsd:simpleType name="BOOK_TYPE">
<xsd:annotation>
<xsd:documentation>Book Type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="1">
<xsd:annotation>
<xsd:documentation>Dr. Seuss</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="2">
<xsd:annotation>
<xsd:documentation>Peter Rabbit</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="3">
<xsd:annotation>
<xsd:documentation>Cinderella</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
Assume there's only one copy of each book. I have a child that come and takes some books. A list represents his/her bag of books.
<xs:simpleType name='bag'>
<xs:list itemType='BOOK_TYPE'/>
</xs:simpleType>
This will allow a list of books, but each book may only be in his bag once. How do I constrain that?
Thanks, Dan
<xsd:simpleType name="BOOK_TYPE">
<xsd:annotation>
<xsd:documentation>Book Type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="1">
<xsd:annotation>
<xsd:documentation>Dr. Seuss</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="2">
<xsd:annotation>
<xsd:documentation>Peter Rabbit</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="3">
<xsd:annotation>
<xsd:documentation>Cinderella</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
Assume there's only one copy of each book. I have a child that come and takes some books. A list represents his/her bag of books.
<xs:simpleType name='bag'>
<xs:list itemType='BOOK_TYPE'/>
</xs:simpleType>
This will allow a list of books, but each book may only be in his bag once. How do I constrain that?
Thanks, Dan