A facet constrains the range of allowable values for simple content.

In NIEM, the most commonly used facets are enumerations (code values). Other examples of a facet include pattern, minLength, and maxExclusive.

Variable | Description | Usage | NDR Reference |
---|---|---|---|

`{$Name}` |
Name of the code type | Required | NDR Section 10.8: Naming Rules |

`{$Definition}` |
The definition of the code type | Required | NDR Rule 9-12: Simple type has definition NDR Rule 9-25: Complex type has definition |

`{$XSDBase}` |
The Schema built-in type that the simple code type is restricting | Required; often "xs:token" | |

`{$Facet}` |
The kind of facet. See "Facet" column in table below for values. | Required. Repeat facet block for each facet value. | |

`{$FacetValue}` |
The value of the facet | Required | |

`{$FacetDefinition}` |
The definition of the facet | Required |

Facet | Description | Text | Numeric | Date |
---|---|---|---|---|

enumeration | An allowable value (a code). | X | X | X |

fractionDigits | The maximum number of decimal places allowed. | X | ||

length | The number of characters of a value. | X | ||

maxLength | The maximum number of characters of a value. | X | ||

minLength | The minimum number of characters of a value. | X | ||

minExclusive | The lower bound - the number must be greater than this constraint. | X | X | |

minInclusive | The lower bound - the number must be greater than or equal to this constraint. | X | X | |

maxExclusive | The upper bound - the number must be less than this constraint. | X | X | |

maxInclusive | The upper bound - the number must be less than or equal to this constraint. | X | X | |

pattern | The regular expression that the value must match. | X | X | X |

totalDigits | The maximum number of digits allowed. | X | ||

whiteSpace | The way white space (spaces, tabs, line feeds, carriage returns) will be handled. | X |

<xs:simpleType name="{$Name}SimpleType"> <xs:annotation> <xs:documentation>A data type for a(n) {$Definition}</xs:documentation> </xs:annotation> <xs:restriction base="{$XSDBase}"> <xs:{$Facet} value="{$FacetValue}"> <xs:annotation> <xs:documentation>{$FacetDefinition}</xs:documentation> </xs:annotation> </xs:{$Facet}> </xs:restriction> </xs:simpleType>

- NDR Rule 7-5: Component naming
- NDR Rule 9-12: Simple type has definition
- NDR Rule 9-23: Code has definition
- NDR Rule 9-25: Complex type has definition
- NDR Rule 9-32: Simple content uses extension
- NDR Section 10.8: Naming Rules
- NDR Rule 11-4: Name of simple type ends in “SimpleType”
- NDR Rule 11-9: Name of a code simple type ends in “CodeSimpleType”
- NDR Rule 11-10: Code simple type has enumerations
- NDR Rule 11-32: Standard opening phrase for complex type
- NDR Rule 11-33: Standard opening phrase for simple type
- NDR Section 11.6.1: Human-readable documentation