XML for Data Architects: Designing for Reuse and Integration

Data type facets are additional metadata constraints that may be applied to a W3C XML Schema data type. From a metadata perspective, facets are metadata rules or limitations for a data type. Data architects will quickly recognize that facets provide extended data type support. The most familiar are those that support lengths and fractional decimal digits. Similar constraints are often defined for the attributes of logical data model entities, for the elements of physical model objects, and for the columns of relational database tables. In addition, most procedural and object-oriented programming languages provide support for constraints that are similar to facets.
Commonly applied facets include the following:
Length (as the number of character positions)
Value limits (minimum and maximum values as a range or threshold)
Decimal digits (both total and fractional)
Enumeration (a list of allowable values)
Patterns (edit patterns including literals and allowable digits)
White space (applied to string or character data)
Length is perhaps the constraint used most often to define the maximum possible length for a data element. Character or string types supported by a database are often defined with a maximum possible number of character positions. Similarly, if the data type is decimal, there may be a defined limit for the total number of digits (often referred to as the "precision") and the number of fractional decimal digits (often referred to as decimal "scale"). W3C XML Schemas provide support for length (in several forms), including total digit, and fractional digit facets.
A string data...