0
J'ai du mal à définir le type de contenu d'un élément ("phonenumber") tout en définissant une propriété ("location") avec des restrictions d'énumération.Définir le type de contenu d'un élément avec un attribut énumérable
est ici où je suis coincé:
<xs:element name="phonenumbers">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="phonenumber">
<!--
Try #1:
Define the type of the attribute "location" and the
content-type of the element "phonenumber". But without
enumeration restrictions on "location".
-->
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="location" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!--
Try #2:
Enumerables in attribute "location" with no content-type
of the element "phonenumber", thus being unable to put
anything in it.
-->
<xs:complexType>
<xs:attribute name="location">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Home"/>
<xs:enumeration value="Work"/>
<xs:enumeration value="Mobile"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>