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

Recursive traversal missing #78

Open
kvetoslavnovak opened this issue Dec 1, 2021 · 8 comments
Open

Recursive traversal missing #78

kvetoslavnovak opened this issue Dec 1, 2021 · 8 comments

Comments

@kvetoslavnovak
Copy link

kvetoslavnovak commented Dec 1, 2021

First of all thank you very much for this great library which helped us with our project a lot!!!

Only feature that we really miss is that JMESPath doesn't have recursive traversal. Like the standard feature // in XPath or .. in JsonPath.

Thank you very much for your response

@darrenmothersele
Copy link

Can you give a use case? or example of what you're trying to achieve?

@springcomp
Copy link

@kvetoslavnovak I believe the let() function coming to JMESPath Community sort of does what you want.

@kvetoslavnovak
Copy link
Author

kvetoslavnovak commented Sep 28, 2022

Can you give a use case? or example of what you're trying to achieve?

E.g. I am trying to get all TYPE_OF_DATE tags/nodes which are all over the different places in my XMLs. Using JSONPath library for the time being.
Example of my code:

  // using JSONPath to get all TYPE_OF_DATE  because JMESPath cannot do recursive traversal (to get non-rooted expressions)
   let TYPE_OF_DATE = JSONPath({
     path: "$..TYPE_OF_DATE",
     json: JSONfile,
   });

Description of // XPath selector is for example here W3School - XPath Syntax

@kvetoslavnovak
Copy link
Author

@kvetoslavnovak I believe the let() function coming to JMESPath Community sort of does what you want.

Thank you very much for this tip.

@kvetoslavnovak
Copy link
Author

kvetoslavnovak commented Jan 1, 2023

@springcomp thank you for the let()tip. But it does not seem to be exactly the right tool nor as easy to use as the others // or .. recursive traversal child selectors usually are.

@springcomp
Copy link

springcomp commented Jan 1, 2023

@kvetoslavnovak I‘ve setup #148 to track this feature.

@kvetoslavnovak
Copy link
Author

@springcomp thank you very much

@springcomp
Copy link

springcomp commented Jun 24, 2023

@kvetoslavnovak We want to propose this feature to JMESPath and will include this in the next iteration for JMESPath Community.

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

No branches or pull requests

3 participants