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 support #30

Open
tecosaur opened this issue Dec 11, 2024 · 0 comments
Open

XPath support #30

tecosaur opened this issue Dec 11, 2024 · 0 comments

Comments

@tecosaur
Copy link

While XML.jl does a great job just with parsing/writing XML documents, it would be great if it provided a few facilities to help work with them too.

One that would be really nice to see is XPath support. I've implemented a simple subset of XPath as a macro in a package of mine:

https://code.tecosaur.net/tec/RestClient.jl/src/branch/main/ext/XMLExt.jl#L102

It works by producing an XPath-getting function from the macro, e.g.

julia> @macroexpand @xpath "some/xpath/@attr"
node -> extract_attr(extract_child(extract_child(node, "some"), "xpath"), "attr")

Perhaps that could be a useful starting point or at least of interest?

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

1 participant