diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 8a0e7d68..76456ffa 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -24,6 +24,37 @@ During constraint evaluation, each `let` statement MUST be evaluated in encounte During evaluation, when a variable is bound for a `let` statement, the variables value MUST be set to the result of evaluating the `@expression` using the current node as the Metapath evaluation focus. +For example: + +Given the following fragment of a Metaschema module. + +```xml + + + + + + + + +``` + +And the following document. + +```xml + + + + + + + + + +``` + +The expect constraint would pass for each `sibling` in the `parent` named "p1", and would fail for each `sibling` in the `parent` named "p2". + ## Enumerated values Additionally, flags may be constrained to a set of known values listed in advance.