getodk / getodk/web-forms

Show error on attempt to treat a nodeset as a single node

Open
#267 0 comments 0 reactions 0 assignees View on GitHub
needs discussion
Dominant language
TypeScript
Stars
38
Forks
22
PR merge metrics
No merged PRs in 30d

Description

This is a controversial proposed deviation from XPath rules. It may not even be practical to consider.

In XPath, when a nodeset is used as a single node, the first node in the nodeset is silently used. This can hide form design problems that will only show up at the analysis stage.

See this form for example: https://test.getodk.cloud/#/projects/149/forms/field_repeated/draft/preview

Collect shows an error in that case: https://docs.getodk.org/collect-troubleshooting/#multiple-values-from-a-dataset-used-as-a-single-value

The error needs some work but it does at least alert people to the fact that something is wrong.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied repeated-field form in the preview and compare its behavior with the Collect troubleshooting guidance. Clarify the proposed XPath deviation, error conditions, and expected wording with maintainers; done should be a decided, reproducible behavior with corresponding coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.