Dr. Gareth S. Bestor
Dr. Gareth S. Bestor
additional background from slack: so it looks like there might be a 'bug' in javarosa regex, in that your provided regex expression must match the entire string - ie implicitly...
I’d probably say we should make the non-standard regex() perform a full match, as Collect does today (sorry, more work for you @MartijnR), fix the ODK spec to reflect that...
And yes, there are situations when a partial match is required; this all came about from a Kobo user trying to figure out why his Enketo constraint was working but...
I must add, to acknowledge @MartijnR 's hard work in 'correctly' implementing `regex()` in Enketo - and now having to potentially 'break it' to maintain compatibility with Collect/javaRosa - that......
Please note that I havent started to try and figure out where in javaRosa/Validate it is doing this supposed static type-checking evaluation. So although it is readily reproducible for dateTime...
my suspicion is that Validate may just be evaluating each binding XPath expression in situ, without actually resolving _any_ (?) instance XML element references to their actual value (substitutes ''...
try this: [validate.xlsx](https://github.com/opendatakit/javarosa/files/3619121/validate.xlsx) BTW XLSForm Online used to throw a type mismatch error, just tried it now and its barfing with "java not found" on it (!) ha. I assume...
Let me try to reproduce.
The issue _was_ that even with a default, for ${year], Validate was throwing an error. That appears to have been fixed recently along the way somehwere (?)... But the root...
> Ideally, form designers would include appropriate constraints so that the runtime exceptions would never be needed As it happens, making the calculation only relevant if ${year} != '' has...