EvilRob.org -> Weblog

Sysadmin Field Notes

Formatting XML with Emacs

June 15, 2009

I always forget this, so here it is so I'll remember. For some reason search engines don't seem to return good results here.

If you've got an ugly, un-tabbed, unformatted blob of xml, just paste it into emacs and do:

M-x xml-mode
M-x sgml-pretty-print

And will be nicely indented. Presumably this requires a modernish Emacs.

Posted by rmeyer at 1:45 PM

This is Rob Meyer's weblog, a weblog focused on software development and system administration based on 10 years of experience. Want to explore further? You can find out more me or see the rest of my website.

Wondering if I've written on something in particular? Try searching:

You might want to take a look at some of the more requested postings (as judged by incoming traffic):

Want more? Subscribe to this site or contact me at rob at big dis dot com.

See my writings on:


Powered by Movable Type | Technorati Profile