Skip to content
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

Validate alignment with ODK Collect on comparisons with booleans #7

Open
eyelidlessness opened this issue Oct 24, 2023 · 2 comments
Open
Labels
@odk/xpath question Further information is requested

Comments

@eyelidlessness
Copy link
Member

@lognaturel had mentioned differing behavior between Collect and Enketo, and linked kobotoolbox/enketo-express#193 for context. My suspicion is the behavior will already be aligned, but it would be good to test just to be sure.

@eyelidlessness eyelidlessness added question Further information is requested @odk/xpath labels Oct 24, 2023
@lognaturel
Copy link
Member

lognaturel commented May 31, 2024

One significant difference: Enketo serializes booleans as strings "true" and "false" which is consistent with xsd:boolean but both are truthy in XPath.

We'd only have to deal with "true"/"false" serialized values when editing submissions from Enketo. We don't document using boolean bind types and it's not in XLSForm so it's generally unlikely that will come up. We do use boolean binds for the Entities spec but we don't apply submission edits to Entities so I don't think it matters. I think all that means it's ok if we don't worry about "false" being deserialized as truthy.

There's another discrepancy identified in this forum thread: in XPath a nodeset of size 1 with an empty node is supposed to be True whereas it's an empty nodeset that's supposed to be False. JR treats an empty node as False. I don't think this is very likely to come up and Web Forms should probably align with XPath and we can document that Collect is not spec-compliant on that front.

Another interesting forum thread on boolean expressions: https://forum.getodk.org/t/relevance-calculated-not-working-on-enketo/26587

@eyelidlessness
Copy link
Member Author

For reference when we come back to this: there was a partial approach to a fix in 2a20d4f (causing some tests to pass as seen in 8176705). Those changes were rolled back in #154, but I wanted to make sure there's an easy way to back reference them to revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@odk/xpath question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants