xml - XSD attribute restriciton and value -
this seems simple haven't found answer yet. have xml using attribute , value together:
<businessidentifier businessidentifiertype="customer number">d123456788</businessidentifier>
which should validate against 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 i'm missing somewhere value d123456789 i'm not sure how put in same element attribute. looked similar trying achieve xml schema how restrict attribute enumeration got error when trying use xs:extension tag
you need define type "complex type simple content". in favourite xml schema reference book.
Comments
Post a Comment