Facets: length

The length facet can be used to constrain an element to contain characters of a fixed length. For example, in the code snippet on the right, 8 indicates that the EmpNumber element can contain only eight characters.

Similarly, in the following code snippet, 6 indicates that the password element can contain only six integers.

    <xs:element name="password">
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:length value="6"/>
        </xs:restriction>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="EmpNumber">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:length value="8"/>
      </xs:restriction>

    </xs:simpleType>
  </xs:element>

// Additional declarations...

Click the Next button to continue.