getodk / getodk/xforms-spec

Proposal: full XPath 1.0 support

Open
#96 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion
Dominant language
CSS
Stars
34
Forks
28
Avg merge
27m
Merged PRs (30d)
1

Description

* all XPath 1.0 **axes** that would allow us to e.g. refer to sibling nodes in various ways (see e.g. #85)
* all XPath 1.0 **functions**, including (maybe more): starts-with(), ends-with(), contains(), substring-after(), substring-before(), translate(), normalize-space(), floor(), ceiling(), last(). The first ones are particularly interesting for querying (external) data using predicates
* all XPath 1.0 **paths** (including e.g. /path/to/@attribute and /path/to/@ns:attribute). Not sure how to argue for this yet, but I'm starting to find this very useful for custom client forks.

We've already started incorporating XPath 2 and XPath 3 features, without fully supporting XPath 1.0. It think full support for XPath 1.0 would provide a great basis for further extensions, in particular custom XPath functions as they can then be implemented by simply translating them to pure (complex) XPath 1.0 expressions. One example is extending the [pulldata() function for XML data](https://github.com/kobotoolbox/enketo-express/issues/250#issuecomment-119689871).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the XPath 1.0 axes, functions, and paths listed in the proposal, along with related issue #85 and the linked pulldata() discussion. Define the supported scope and completion criteria for full XPath 1.0 coverage, including attribute and namespace paths, before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
documentation
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.