Is there a jq, but for xml? And yes, I know about xslt, but looking for something more simple.
Conversation
A web search did turn up xml-to-json and vice versa, but would like something more native.
1
1
Replying to
XPath and XSLT are the native approach. If you use Python for scripting, lxml has an implementation of both:
lxml.de/xpathxslt.html
It can also translate CSS selectors to XPath expressions and supports those for XML rather than only HTML:
lxml.de/cssselect.html
2
1
The supported CSS selectors are documented at cssselect.readthedocs.io/en/latest/#sup. I tend to use lxml with cssselect for dealing with XML since I don't have to learn something new and can mostly apply the stuff I already know from dealing with HTML and CSS.
1
i.e. it's the table in w3.org/TR/2011/REC-cs without the ones they list as unsupported / always empty.

