How can i validate the text length of the element that has an attribute. E.g:
<sport code="FB">Football</sport>
Now i need to restrict the possible values of the code attribute(like "FB", "BB", "TT") and also i need to restrict the possible values and length of the text("Football", "BasketBall", "TableTennis") and also the maximum length of these text("Football", "BasketBall", "TableTennis") can be 20.
I tried with
<complexType name="sport">
<simpleContent>
<extension base="string">
<attribute name="code" type="code" />
</extension>
</simpleContent>
</complexType>
<simpleType name="code">
<restriction base="string">
<enumeration value="FB" />
<enumeration value="BB" />
<enumeration value="TT" />
</restriction>
</simpleType>
But i cant validate the length of the text "Foolball" (also the possible values) Can you please help about how to validate both the code and the text. Thanks