Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boyvinall/goxpath
stupid thing to make xpath queries easier from bash
https://github.com/boyvinall/goxpath
Last synced: 5 days ago
JSON representation
stupid thing to make xpath queries easier from bash
- Host: GitHub
- URL: https://github.com/boyvinall/goxpath
- Owner: boyvinall
- License: gpl-2.0
- Created: 2015-09-07T15:14:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-26T10:50:39.000Z (over 8 years ago)
- Last Synced: 2024-06-20T08:14:34.027Z (5 months ago)
- Language: Go
- Size: 10.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goxpath
[![Build Status](https://travis-ci.org/boyvinall/goxpath.svg?branch=master)](https://travis-ci.org/boyvinall/goxpath) [![Issue Count](https://codeclimate.com/github/boyvinall/goxpath/badges/issue_count.svg)](https://codeclimate.com/github/boyvinall/goxpath)
Stupid thing to make xpath queries easier from bash. Try a quick google for `bash xpath` and you might be disappointed. #wahwahwah
NB - due to dependence on gokogiri, you need to install libxml2-devel to build this. (Sorry, I'm still a bit of a golang n00b. :blush:)
It'll read from stdin by default
## Install
yum install libxml2-devel # see above, soz
go get github.com/boyvinall/goxpath## Examples
./goxpath -xmlns foo:http://foo -xmlns bar:http://bar -xpath //foo:stuff/bleh -file file.xml
./gopath -h # NB: see ENV names e.g. $XP_XMLNS
curl -s http://example.com/doc.xml | goxpath -xpath //example
export XP_XMLNS=foo:http://foo,bar:http://bar # define in the ENV, separate with comma
goxpath -xpath //foo:stuff file.xml