GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

[Bug] SymbolicFunction expression containing commas inputs fail XML validation

Open klevzoff opened this issue 3 years ago • 1 comments

Describe the bug A really minor inconvenience, but a SymbolicFunction expression with commas (which are necessary for using some binary functions, e.g. pow(x,y)) fails validation, because our validation regex pattern for strings does not allow commas.

To Reproduce Steps to reproduce the behavior:

  1. Modify examples/functions/function_examples/function_examples.xml to use a binary builtin function (e.g. pow)
  2. Run the full build up to the XML validation step
  3. Get error message like
ERROR:SCHEMASV:SCHEMAV_CVC_PATTERN_VALID: Element 'SymbolicFunction', attribute 'expression': [facet 'pattern'] The value 'pow(x,1.5)' is not accepted by the pattern '.*[\[\]`$].*|[^,\{\}]*'.

Expected behavior Should not fail validation.

Additional context The reason to not allow commas in string inputs is probably so that regex for string_array is unambiguous (it adds commas between array elements). But I suspect if we allowed it, validation would still work fine, the regex would possibly match a different number of strings (when some are separated by commas with no spaces, they may get mashed into one). This doesn't affect the actual GEOSX parser in any case. Instead, we should prohibit spaces in string regex, because a space is never read by operator>> so a string like "ab cd" will validate but GEOSX will only read "ab".

klevzoff avatar Feb 12 '22 06:02 klevzoff

Sounds reasonable. If I recall correctly, whitespace isn't allowed in symbolic functions anyway.

cssherman avatar Feb 14 '22 19:02 cssherman