Command-line XML processor inspired by jq
% cat aho.xml
<ul><li>foo</li><li>bar</li></ul>
- formatting with
.
% cat aho.xml | xq .
<?xml version="1.0"?>
<ul>
<li>foo</li>
<li>bar</li>
</ul>
- css filtering that starts with "."
% cat aho.xml | xq .li
<li>foo</li>
<li>bar</li>
- css filtering with case-ignore
% cat aho.xml | xq -i .LI
<li>foo</li>
<li>bar</li>
- Assumed that we are using
ubuntu-16.04
andcrystal-0.22.x
.
Please install libxml2.a
first as bellow.
make
We can't link statically against libxml2 due to lack of ICU_XXX
in ubuntu-16.04
.
So we manually build libxml2.a
without icu first.
apt-get install automake # for `aclocal`
apt-get install liblzma-dev
apt-get install python2.7-dev
apt-get source libxml2
cd libxml2-2.9.3+dfsg1
./configure --with-python=no --with-trio=no --with-http=no --with-ftp=no
make
sudo mv /usr/lib/x86_64-linux-gnu/libxml2.a{,.dist}
sudo cp -p .libs/libxml2.a /usr/lib/x86_64-linux-gnu/
- Fork it ( https://github.com/maiha/xq.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- maiha maiha - creator, maintainer