Skip to content

Commit

Permalink
Add assembly allowed-values constraint spec
Browse files Browse the repository at this point in the history
This is needed for proper context in usnistgov#411.
  • Loading branch information
aj-stein-nist committed Aug 18, 2023
1 parent 06d4f07 commit d39dfc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions website/content/specification/syntax/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly

### `define-assembly` constraints

An assembly can define `allowed-values` constraints. Unlike flag and field constraints, those for an assembly has a `target` attribute to indicate the location of element(s) where the enumerated values are applicable for strict or loose validation. A Metaschema processor MUST parse the right-hand side of the `target` attribute, a Metapath expression, to correctly apply strict or loose validation to the relevant elements that match this expression. Below is an example.

### Multiple allowed value constraints for the same target

A Metaschema processor MUST process and support validation of content instances of Metaschema modules with multiple `allowed-values` constraints for the same targets with an implicit or explicit `allow-other="no"` directive. Fields and flags may have their own internal enumerations, and assemblies themselves can define additional `allowed-values` constraints with `target` attributes for context-sensitive constraints to the same fields and flags, the result is compositional. A Metaschema processor MUST validate content instances with these constraints when there is an explicit or implicit `allow-other="no"` as a union of all enumerations applicable to the context-sensitive target. Below is an example.

```xml
```

0 comments on commit d39dfc8

Please sign in to comment.