Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ability to express common constraints without XPath #2281
#2242 introduces min/max length via XPath functions:
The UI then roundtrips to the user-friendly UI by parsing a closed set of XPath expressions.
There is also a mechanism whereby such constraints are stored as MIPs, making them available to the UI when possible.
This issue expands the idea to a larger set of validations, including:
UI must not show validations which don't make sense for the current type (but if present leave them), which means we
See also the XML Schema facets:
It would be good if specific constraints were only listed for types to which they can apply. For example,
Now if the user changes the datatype, what should happen to the constraint? It should not be automatically removed, but it should probably be marked with a warning.
added a commit
Jan 15, 2016
We have more validation suggestions from customer. They fall in different categories.
Some could be implemented via regex. For example:
Maybe we could have a general mechanism to add a collection of regex validations? What would it take?
Some need more complex logic better implemented in native code:
How would such a collection of regexp be stored? There are at least two easy ways:
Option 1 prevents reuse between form definitions.
Option 2 lacks a UI and makes the feature much harder to use.
Like with #3120, we can suggest creating a special singleton form for creating and maintaining the library of validations. Orbeon Forms could come with a predefined collection of such validations, and form authors could extend this collection.
Like for section templates:
The format in the form definition is TBD. Like for dynamic labels, we might have to move to nested elements within binds, for example:
<xf:bind ...> <fr:validation name="some-validation-id"/> </xf:bind>
We also would like to have 4 levels, ideally, instead of just 2 for section templates right now:
It would be nice to be able to copy/paste/move between levels.