Does anyone know of a similar tool for XML? In particular, it would be cool to have a useful way to run xpath, and maybe xquery, from the command line. The tools I've found have unfortunate interfaces, e.g. they won't read XML from stdin.
See this blog post I wrote a while ago for an example: http://jeroenjanssens.com/2013/09/19/seven-command-line-tool...
[ {"tag":"something", "attributes": { ... }, "nodes": [ ...] }, ... ]
with nodes being objects with one key to indicate if the node is a text node or an element, and if a text node then a value, and so on.http://www.w3.org/Tools/HTML-XML-utils/
However, I just use a Ruby script which loads the Nokogiri library:
https://github.com/clarkgrubb/data-tools/blob/master/src/dom...
https://github.com/clarkgrubb/data-tools/blob/master/doc/dom...