Last Updated: February 25, 2016
· squioc

Get a pretty-print xml from a site (or a remote location)

Sometime, you have to retrieve an xml document from a remote site (like wsdl for a webservice or whatever). But often, you get a flat file unreadable.

To obtain a pretty-print xml document, throw it content into xmllint as follow:

curl http://server/remotefile.xml | xmllint --format - 

You can obtain your document from a remote server via ssh as well.

ssh account@server 'cat remotefile.xml' | xmllint --format -