About Facet Types for simpleTypes

Table 59 provides a brief description of what you should specify as the value of a facet for a new simpleType. You should consult the XML Schema Recommendation for a complete definition of each facet and its allowable values.

Facet
Value
enumeration
One allowable value. Add an enumeration facet for each allowable value. For example:
<xsd:simpleType name="USState"> 
  <xsd:restriction base="xsd:string"> 
    <xsd:enumeration value="AK"/> 
    <xsd:enumeration value="AL"/> 
    <xsd:enumeration value="AR"/> 
    <!-- and so on ... --> 
  </xsd:restriction> 
</xsd:simpleType>
fractionDigits
The maximum number of digits that are allowed in the fractional portion of values of simpleTypes that are derived from xsd:decimal.
length
The number of units of length. Units vary according to the base type. The simpleType must be this number of units of length. For example, if xsd:string is the base type, you might specify 5 as the length if you know that each value will be a code that always has five characters.
maxExclusive
The exclusive upper bound of the range of values allowed for this simpleType. The value of the simpleType must be less than the value of maxExclusive.
maxInclusive
The inclusive upper bound of the range of values allowed for this simpleType. The value of the simpleType must be less than or equal to the value of maxInclusive.
maxLength
The maximum number of units of length. Units vary according to the base type. The length of the instances of this simpleType must be less than or equal to this number of lengths.
minExclusive
The exclusive lower bound of the range of values allowed for this simpleType. The value of the simpleType must be more than the value of minExclusive.
minInclusive
The inclusive lower bound of the range of values allowed for this simpleType. The value of the simpleType must be equal to or more than the value of minInclusive.
minLength
The minimum number of units of length. Units vary according to the base type. The length of the instances of this simpleType must be equal to or more than this number of lengths.
pattern
A regular expression. The values of the simpleType must be literals that match this regular expression.
totalDigits
The maximum number of digits that are allowed in values of simpleTypes that are derived from xsd:decimal.
whiteSpace
Specify one of the following values:
Table 59. Facet Values for simpleTypes

Web Service Data Mapping

Stylus Studio makes it possible for you to use Web services as live XML data sources for XML mapping projects.

Hotels, Casinos & Resorts That Use Stylus Studio

What's more romantic than a vacation for two and the world's best XML IDE at your finger tips? Nothing, that's why these hotels, casinos, & resorts are using Stylus Studio to help you get on your dream vacation.

Stylus Studio Enables Multi-Channel Publishing for University of Pittsburg Professor

Learn how Dr. David Birnbaum of the University of Pittsburgh uses Stylus Studio to develop customized XSLT stylesheets that produce enhanced versions of source documents in different output formats, including Web and print.

XML Schema Validation

Validate XML using XML Schema with MSXML, XERCES, XSV, SYSTEM.XML, & other XSD Validators. Stylus Studio's XML Schema-Aware XML Editing makes XML Schema Validation a snap!

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member