This seems fairly simple but I haven't found an answer yet. I have xml using an attribute and value together:
<BusinessIdentifier businessIdentifierType="Customer Number">D123456788</BusinessIdentifier>
Which should validate against the schema:
<xs:simpleType name="BusinessIdentifierTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="Plan Number"/>
<xs:enumeration value="Customer Number"/>
<xs:enumeration value="Scheme Number"/>
<xs:enumeration value="Agency Code"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="BusinessIdentifier">
<xs:complexType>
<xs:attribute name="businessIdentifierType" type="BusinessIdentifierTypes" use="required"/>
</xs:complexType>
</xs:element>
I can see that I'm missing somewhere for the value D123456789 but I'm not sure how to put that in the same element as well as the attribute. This looked similar to what I was trying to achieve XML Schema How to Restrict Attribute by Enumeration but I got an error when trying to use the xs:extension tag