xq
Version, currently 0.3.03 versions
- 0.3.0latestOct 24, 2017
- 0.2.0not indexedOct 24, 2017
- 0.1.0not indexedOct 24, 2017
github.com/maiha/xq.cr
Command-line XML processor inspired by `jq`
21 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
xq:
github: maiha/xq.cr
version: ~> 0.3.0Then run:
shards installshard.yml
- Crystal
0.22.0- License
- MIT
- Author
- maiha <maiha@wota.jp>
Dependencies
Runtime Dependencies
- app>= 0.4.3github: maiha/app.cr
- var>= 0.1.0github: maiha/var.cr
README
# xq.cr
Command-line XML processor inspired by `jq`
## Installation
#### Static Binary is ready for x86_64 linux
- https://github.com/maiha/xq.cr/releases
## Usage
```shell
% cat aho.xml
<ul><li>foo</li><li>bar</li></ul>
```
#### v0.1.0
- formatting with `.`
```shell
% cat aho.xml | xq .
<?xml version="1.0"?>
<ul>
<li>foo</li>
<li>bar</li>
</ul>
```
#### v0.2.0
- css filtering that starts with "."
```shell
% cat aho.xml | xq .li
<li>foo</li>
<li>bar</li>
```
#### v0.3.0
- css filtering with case-ignore
```shell
% cat aho.xml | xq -i .LI
<li>foo</li>
<li>bar</li>
```
## Development
- Assumed that we are using `ubuntu-16.04` and `crystal-0.22.x`.
Please install `libxml2.a` first as bellow.
```shell
make
```
### static libxml2.a
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/
```
## Contributing
1. Fork it ( https://github.com/maiha/xq.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [maiha](https://github.com/maiha) maiha - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.0- Tagged
- Oct 24, 2017
- Commit
1b99f5535179- Crystal
0.22.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/maiha/xq.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 3