I'm trying to construct a nodeset from responses (for use in functions like min()
and max()
).
According to the docs:
Nodesets can also be created by joining two or more nodes with pipes:
/data/age | /data/name
.
But when I try this, I get an error.
Form:
type name label calculation
integer n1 N1
integer n2 N2
integer n3 N3
calculate max max(/data/n1 | /data/n2 | /data/n3)
note maxnote Max: ${max}
max-test.xlsx (28.0 KB)
Error:
b'ODK Validate Errors:\n' + ErrorCleaner.odk_validate(stderr).encode('utf-8'))
pyxform.validators.odk_validate.ODKValidateError: b"ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nError evaluating field 'max': The problem was located in calculate expression for ${max}\nXPath evaluation: unsupported construct [max(${n1} | ${n2} | ${n3})]\nCaused by: org.javarosa.xpath.XPathUnsupportedException: The problem was located in calculate expression for ${max}\nXPath evaluation: unsupported construct [max(${n1} | ${n2} | ${n3})]\n\t... 10 more\n\nResult: Invalid"
Note that something weird is happening here in the error, too. The error is referencing the calculation function with the dollar-sign-curly-bracket syntax: unsupported construct [max(${n1} | ${n2} | ${n3})]
.
I tried this first (and it didn't work), but then changed it to the /data/n1
syntax. No change in error output. I don't know if that is meaningful.