Finding data from XML with command-line
You can use xmllint
from libxml and xmlstarlet
to run queries against XML-files. Personally I prefer xmlstarlet, because it accepts XML namespaces on command-line, whereas xmllint needs to start a shell if you want namespaces.
curl reddit.com/r/programming.rss | xmllint --xpath '//item/title'
curl reddit.com/r/programming.rss | xmllint sel -t -v '//item/title'
Written by Mats Rauhala
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Tags
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#