pyjab
pyjab copied to clipboard
Xpath Parser enhancement
Xpath Parser enhancement. Set Xpath Parser almost like this Xpath
-
Nodes
- [x] nodename : select specific nodename
- [ ] / : select from root node(get child node)
- [ ] // : select any matched node ignore current node position(get child node)
- [ ] . : select current node
- [ ] .. : select parent node
- [x] @ : select node attribute
-
Predicates
- [x] /foo/bar[1] : select the first element 'bar' from element 'foo'
- [ ] /foo[@name = 'bar']: select all 'foo' elements that attribute "name" attribute with a value of "bar"
- [ ] /foo[@indexinparent > 10]: select all 'foo' elements which attribute "indexinparent" large than 10
-
Unkown Nodes
- [x] //* : match any element node
-
Several Paths
- [ ] //foo/bar | //foo/baz : select all the 'bar' and 'baz' elements of all 'foo' elements
- [ ] //foo | //bar : select all the 'foo' and 'bar' elements in document
-
Axes(In future)
-
Operations
- [ ] //foo | //bar : computes two node-sets
- [ ] @name = 'foo' : name equals to string 'foo'(also need support for other attribute)
- [ ] @role != 'foo' : role not equal to string 'foo'(also need support for other attribute)
- [ ] @indexinparent < 2 : index in parent less than 2(also need support for objectdepth)
- [ ] @indexinparent <= 2 : index in parent less than or equal to 2(also need support for objectdepth)
- [ ] @indexinparent > 2 : index in parent greater than 2(also need support for objectdepth)
- [ ] @indexinparent >= 2 : index in parent greater than or equal to 2(also need support for objectdepth)
- [ ] @name = 'foo' or @name = 'bar' name equals to string 'foo' or 'bar'
- [ ] @name = 'foo' and @role = 'bar' name equals to string 'foo' and role equals to string 'bar'