Accueil > sinarf > very simple way to pretty print xml from command line

very simple way to pretty print xml from command line

I was looking for a tool to format xml, making it more readeable, under Linux you can use xmllint. It’s included in libxml2 and thererfore should be availlaible in any distribution. The use is very simple :
$ xmllint --format myXmlFile.xml
It will pretty print to the console to have in a file just redirect the default output to a file.
$ xmllint --format myXmlFile.xml > myPrettyPrintedFile.xml

And that’s it!

Categories: sinarf Tags: , ,
  1. Pas encore de commentaire
  1. Pas encore de trackbacks

Spam protection by WP Captcha-Free