Read more

How to inspect XML files in a terminal

Arne Hartherz
July 04, 2013Software engineer at makandra GmbH

You can use xmllint to pretty-print ugly XML files on your terminal. Just say:

xmllint --format file.xml
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

That will restructure containers nicely into individual sections with proper indentation.\
Note that it will automagically work on gzipped XML files!

To write pretty output to a new file, just use the -o switch (short for --output):

xmllint --format file.xml -o pretty_file.xml

See the xmllint man page Show archive.org snapshot for other useful switches and more information.

Posted by Arne Hartherz to makandra dev (2013-07-04 11:17)