Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpath Parser enhancement #58

Open
4 of 21 tasks
gaozhao1989 opened this issue Jul 13, 2022 · 2 comments
Open
4 of 21 tasks

Xpath Parser enhancement #58

gaozhao1989 opened this issue Jul 13, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@gaozhao1989
Copy link
Owner

gaozhao1989 commented Jul 13, 2022

Xpath Parser enhancement.
Set Xpath Parser almost like this Xpath

  1. Nodes

    • 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
    • @ : select node attribute
  2. Predicates

    • /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
  3. Unkown Nodes

    • //* : match any element node
  4. 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
  5. Axes(In future)

  6. 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'
@gaozhao1989 gaozhao1989 added the enhancement New feature or request label Jul 13, 2022
@gaozhao1989 gaozhao1989 self-assigned this Jul 13, 2022
@KinsonWong
Copy link

大佬好!我认为可以将JabElement的树形结构写到xml里面,再调用第三方的xpath包去解析可能会更好

@gaozhao1989
Copy link
Owner Author

大佬好!我认为可以将JabElement的树形结构写到xml里面,再调用第三方的xpath包去解析可能会更好

Hi @KinsonWong,

Thanks for your feedback.

As existing implementation, current JABElement locate strategy already have performance issue here(without Tree node).
It will take extra effort on Tree node structure maintain.

Any other suggestion, please let me know and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants