Semantic Web Technologies: XML, RDF, OWL

XML Complex Types by Extension

<?xml version="1.0" encoding="ISO-8859-1"?>

<!--The new type-->
<xsd:complexType name="telephoneNumberEx">
  <xsd:complexContent>
    <xsd:extension base="telephoneNumber">
      <xsd:sequence>
        <xsd:element name="countryCode">
          <xsd:simpleType>
            <xsd:restriction base="xsd:string">
              <xsd:pattern value="\d{2}"/>
            </xsd:restriction>
          </xsd:simpleType>
        </xsd:element>
      </xsd:sequence>
    </xsd:extension>
  </xsd:complexContent>
</xsd:complexType>

<!--An instance of the type-->
<telephone xsi:type="abc:telephoneNumber">
  <area>123</area>
  <exchange>123</exchange>
  <number>1234</number>
  <contryCode>01</countryCode>
</telephone>

José M. Vidal .

12 of 41