Formatting XML on command-line
You can use xmllint
from libxml or xmlstarlet
to format XML. Take for example curl http://www.reddit.com/r/programming.rss
which returns an RSS-feed in one line, completely unreadable.
Try doing curl http://www.reddit.com/r/programming.rss | xmllint --format -
instead to get a nicely formatted xml
You can also do curl http://www.reddit.com/r/programming.rss | xmlstarlet fo
which I prefer personally, but it might not be installed beforehand.
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#