3 ms·
REQUEST: jq is great for json - but is there a "jq for xml"? Some webservices are still only available in xml (e.g. uv levels). I currently use XMLStarlet for
by hyperpallium 8y ago
REQUEST: jq is great for json - but is there a "jq for xml"?
Some webservices are still only available in xml (e.g. uv levels). I currently use XMLStarlet for xml in the terminal. There are extra annoyances in xml that you can't avoid (like namespaces), but it could be a lot closer to jq.
- eigengrau 8y agoI’ve used https://github.com/ericchiang/xpup https://github.com/ericchiang/xpup for this a few times.
- hyperpallium 8y agoThanks, seems the right idea, but browsing the code, decode just interprets a single xpath expression. While that is useful (and I've used xpath from the CL like before), I found I quickly needed to be able to chain them together etc. pup (https://github.com/ericchiang/pup/blob/master/README.md https://github.com/ericchiang/pup/blob/master/README.md) which apparently inspired xpup does seem to have this, e.g. chaining, but unfortunately it uses css selectors instead of xpath.
- everybodyknows 8y agoxml2 -- for simple tasks.