-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can "match" syntax / semantics be simpler? #582
Comments
I agree with this concern. Requiring XPath semantics is a problem. A simple glob syntax would be easier to use and less problematic for anyone not using the XML stack. |
With regex communities always get into the discussion of which regex to use. XMLSchema regex is a good minimal choice. I believe it is compatible in its reduced feature set with My guess is XMLSchema regex is also close to being compatible with the regex from ECMA 262, which is used in JSON Schema. I notice that negative and positive lookahead is supported here, but not in XML Schema. Perhaps we need to specify against the common set of features supported by XML Schema and JSON Schema? This may involve us defining that allowed subset. |
Talked with the OSCAL model review community about this today. There was consensus on the call to simplify matching to support only a [glob wildcard](https://en.wikipedia.org/wiki/Glob_(programming) pattern. We can consider adding a regex matching feature in the future, when we have more time to talk through the regex flavor to specify. |
Profile resolution to be merged into branch #882 now supports glob syntax in |
In the proposed resolver spec, for
match
, the intepretation of thepattern
is "The match pattern is evaluated as a regular expression using XPath regular expression syntax".I'm a bit concerned that this is too complex to implement completely unless you have a fully conformant XPath 2.0 engine. In particular, some of the backtracking and group matching options look hard to emulate completely, and really hard to test.
I think I'd like something simpler, like the XML Schema regexp syntax, or even simpler than that (just a basic glob operation, perhaps). It could also be worth reviewing whether implicit anchoring is worth considering (i.e. it always has to match the whole control, like XML Schema does).
This is based on what we usually mean - "I want all of those controls without needing to identify them all". So something like
<match pattern="au-*"/>
would probably be enough.We don't really need subtraction (because we have
<exclude>
), we don't absolutely need alternation (becausematch
can be repeated if you want a few different prefixes), we almost certainly don't need backtracking, grouping or anchors. It might be nice to have ranges and single character match, but that could be enough.The text was updated successfully, but these errors were encountered: