Skip to content
/ xq Public

Wrap some xpath functionality into a command-line app, to parse XML similar to jq

License

Notifications You must be signed in to change notification settings

sbowman/xq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xq

A simple XML parser that exposes the https://github.com/antchfx/xmlquery to the command line. Use XPath queries to search for information in XML documents, or execute basic XPath expressions to convert data.

Find

To search for elements, use the --find command:

cat sample.xml | ./xq --find '//MyElement[@someattr="abc"]'

Exec

To execute an XPath expression, use the --exec command:

cat sample.xml | ./xq --exec 'count(//MyElement)'
cat sample.xml | ./xq --exec 'sum(//MyElement@bytes

Dependencies

This app is really just a simple CLI wrapper around these two great Go XML packages:

About

Wrap some xpath functionality into a command-line app, to parse XML similar to jq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages