Skip to content

boyvinall/goxpath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goxpath

Build Status Issue Count

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. 😊)

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

About

stupid thing to make xpath queries easier from bash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published