Semantic Web Technologies: XML, RDF, OWL

XML Simple Types

<?xml version="1.0"?>

<!-- A product code is 2 digits, a dash, and five digits-->
<!-- It restricts string. -->
<xsd:simpleType xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" name="productCode">
  <xsd:restriction base="xsd:string">
    <xsd:pattern value="\d{2}-\d{5}"/>
  </xsd:restriction>
</xsd:simpleType>

<!--We can extend this product code by allowing an optional-->
<!--dash followed by a letter -->

<xsd:simpleType name="productCodeEx">
  <xsd:restriction base="productCode">
    <xsd:patter value"\d{2}-\d{5}(-[a-z]){0,1}"/>
  </xsd:restriction>
</xsd:simpleType>


José M. Vidal .

10 of 41