From d19b35d668184fdac00a8ef56ff58c0748f22816 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 12 Aug 2021 11:09:58 -0500 Subject: T3574: add constraintGroup for combining validators with logical AND (cherry picked from commit 591b8bcadd8b6bbd46c61484193d2bf7e16bd1ae commit 31553283aaa929da63147082e85513e8d4dacf0e commit 59a4aadfe419eca16e6288b37d6c51acd9789903) --- schema/interface_definition.rnc | 11 +++++++++++ schema/interface_definition.rng | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'schema') diff --git a/schema/interface_definition.rnc b/schema/interface_definition.rnc index 6647f5e11..d7fc4966c 100644 --- a/schema/interface_definition.rnc +++ b/schema/interface_definition.rnc @@ -93,6 +93,7 @@ properties = element properties { help? & constraint? & + constraintGroup* & valueHelp* & (element constraintErrorMessage { text })? & completionHelp* & @@ -140,6 +141,16 @@ constraint = element constraint validator )+ } +# Tag and leaf nodes may have constraintGroups on their names and +# values (respectively). +# When multiple constraints are listed within a group, they work as +# logical AND +constraintGroup = element constraintGroup +{ + ( (element regex { text }) | + validator )+ +} + # A constraint may also use an external validator rather than regex validator = element validator { diff --git a/schema/interface_definition.rng b/schema/interface_definition.rng index 22e886006..3ff60cf18 100644 --- a/schema/interface_definition.rng +++ b/schema/interface_definition.rng @@ -160,6 +160,9 @@ + + + @@ -244,6 +247,24 @@ + + + + + + + + + + + + + -- cgit v1.2.3