I'm trying to find a simple cli command to do xquery from linux shell. What I'd like is to avoid external dependencies that I need to install (using fedora 18).
What I already found is saxon and xqilla that I can install through yum. I can use them if nothing else but they are not in the base system. What I hoped to find is something like the java internal class for doing xslt processing (com.sun.org.apache.xalan.internal.xsltc.cmdline.Transform).
One other idea I have is use XSLT to transform the document to the desired xquery result but one-liners would not be possible.
example of what I can do with xqilla (but searching for another utility):
$ xqilla -i TEST-com.ecample.testcase.MyTestCase.xml <(echo '/testsuite/@failures + /testsuite/@errors')
UPDATE: not exactly the question I had but I settled on perl XML::Twig being installed by default and giving me the flexibility to implement complicated logic with perl. That also led to a nice speed boost because there is no need to fork a process for each XML file.
javax.xml.XPath
? – rmlanxqilla
is the best I've found that's open-source and not Java. It seems not very well-known either. Outside Java it might be the only lib with any Xpath2 support. – ormaaj