Skip to content

Commit

Permalink
Fixes indenting/stylings; adds eslint; updates docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsummersl committed Nov 27, 2019
1 parent 499de0f commit 340b14a
Show file tree
Hide file tree
Showing 6 changed files with 795 additions and 28 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
};
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,25 @@ xml2js.parseString('<root><element id="15">target</element></root>', function(er
```

See test cases for more examples.

XPath Support
=============

Only a subset of [the XPath standard](https://www.w3.org/TR/1999/REC-xpath-19991116/) is currently supported:

- [X] Descendent selectors (`//h`, `/parent/offspring`).
- [X] Attribute selectors (`/parent/offspring[@attribute='value']`).
- [X] Tag value selectors (`/parent[offspring='value']`).

Notable unsupported features (there are many more, but these are some I'd like
to support at some point!):
- [ ] Order predicate (`/parent/offspring[1]`)
- [ ] Arithmetic comparisons (`/parent/offspring[@attribute > 12.5]`)
- [ ] Boolean logic (`/parent/offspring[@attribute1 or @attribute2]`)
- [ ] Axes (`/parent/following-sibling::offspring`)
- [ ] Functions ( `last()`, `starts-with()`, `contains()`, `text()`, etc).


https://www.w3.org/TR/1999/REC-xpath-19991116

https://codebeautify.org/Xpath-Tester
Loading

0 comments on commit 340b14a

Please sign in to comment.