Pretty printing with Emacs

I recently completed a proof of technology using Spring Web Services to host a SOAP over JMS service. While writing it up for distribution on a so-called Sharepoint "wiki" I needed to include the applicationContext.xml. Pretty printing the XML with syntax highlighting seemed like a good idea.

GNU's xmllint --format --htmlout was my first attempt but this does a pretty poor job in that all it does is wrap the formatted output in an HTML header and footer. I found nothing for Eclipse other than the Java2Html plugin.

A somewhat foggy recollection of doing a similar thing in the past led me to reacquaint myself with Emacs Htmlize which I hadn't updated since 1999. Needless to say quite a few new features have been added in the interim and using an htmlize-output-type of "inline-css" generated exactly what was needed to paste into the "wiki".

posted by James Gemmell on Wed, 31 Mar 2010 at 09:26 | permalink | tags: emacs, html, jms, spring, xml