0.0.1-beta.0 • Published 6 years ago
odk-xpath v0.0.1-beta.0
Openrosa XForms Evaluator
Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.
For more info on extended XPath expressions/bindings supported by XForms/OpenRosa/OpenDataKit (ODK) see:
TODO
Check that UUID generation is correct (random? UUID vX?)
Limitations
Any expression made requesting a node-type result will be delegated to the underlying xpath evaluator.
Also, the expression parser is currently very basic and will fail for some xpath expressions. Some examples of expressions that are and are not supported follow.
Supported XPath expressions:
/model/instance[1]//*/model/instance[1]/*/meta/*./authorauthorfirst.name/bookstore//authorauthor/first-namebookstore//titlebookstore/*/titlebookstore//book/excerpt//emph.//titleauthor/*book/*/last-name@styleprice/@exchangeprice/@exchange/totalbook[@style]book/@style./first-namefirst-nameauthor[1]author[first-name][3]my:bookx/y[1]x[1]/y[2]book[excerpt]book[excerpt]/titlebook[excerpt]/author[degree]book[author/degree]author[degree][award]ancestor::book[1]ancestor::book[author][1]ancestor::author[parent::book][1]*/**[@specialty]@*@my:*my:*author[degree and award]author[(degree or award) and publication]author[degree and not(publication)]author[not(degree or award) and publication]author[. = "Matthew Bob"]author[last-name = "Bob" and ../price > 50]author[not(last-name = "Bob")]author[first-name = "Bob"]author[last-name = "Bob" and first-name = "Joe"]author[* = "Bob"]author[last-name = "Bob"]author[last-name[1] = "Bob"]author[last-name [position()=1]= "Bob"]book[last()]book/author[last()]book[position() <= 3]book[/bookstore/@specialty=@style]degree[position() < 3]degree[@from != "Harvard"]p/text()[2]price[@intl = "Canada"]x/y[position() = 1](book/author)[last()](x/y)[1]
Unsupported XPath expressions:
(Add any examples of known-unsupported expressions here and to test/extended-xpath.spec.js.)
0.0.1-beta.4
6 years ago
0.0.1-beta.3
6 years ago
0.0.1-beta.2
6 years ago
0.0.1-beta.1
6 years ago
0.0.1-beta.0
6 years ago