Created
May 9, 2014 20:37
-
-
Save lstroud/4703bad44c01c0c9a3da to your computer and use it in GitHub Desktop.
xml xpath selector one-liners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -u aname "http://someserver/deploylist.xml" | xmllint --xpath '//deploy-name/text()' - | |
curl -u aname "http://someserver/deploylist.xml" | ruby -r nokogiri -e 'd=Nokogiri::XML($stdin); puts d.xpath("//deploy-name/text()")' | |
curl -u aname "http://someserver/deploylist.xml" | node -e "var i=process.stdin; i.resume(); i.on('data', function(d) { require('xpath').select('//deploy-name/text()', (new (require('xmldom')).DOMParser()).parseFromString(d.toString())).forEach(function(n){console.log(n.textContent);}); });" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment