Mega Code Archive

 
Categories / XML / XML Schema
 

Constrain our dotted-quad to use 3-digit numbers in the range 0 to 255

<?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="ipv4_Address">     <xs:restriction base="xs:string">       <xs:pattern         value="(([0-9]{1,2} | [1][0-9]{2} | [2][0-4][0-9] | [2][5][0-5])\.){3}                  ([0-9]{1,2} | [1][0-9]{2} | [2][0-4][0-9] | [2][5][0-5])" />     </xs:restriction>   </xs:simpleType> </xs:schema>