Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Constrain a data type to be a single constant value

<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"   targetNamespace="http://www.rntsoft.com" xmlns="http://www.rntsoft.com"   elementFormDefault="qualified">   <xs:simpleType name="TheAnswer">     <xs:restriction base="xs:integer">       <xs:minInclusive value="42" />       <xs:maxInclusive value="42" />     </xs:restriction>   </xs:simpleType> </xs:schema>