jkbr/httpie — pull request #114 by jargonjustin (2012-12-17 21:57:11+00:00)
Title: Pretty print XML

Adds an XML processor to pretty print XML response types.

It looks like there was some previous discussion about this in #34. While this change uses the new plugable processor API, it doesn't address:

> However, the method used here inserts a lot of blank lines. A bit less agressive formatting is needed.

A little research on pretty printing XML with Python revealed a few options:

1. Use `xml.dom.minidom` which apparently does a mediocre job in many cases
2. Use [PyXML](http://pyxml.sourceforge.net/topics/) or [lxml](http://lxml.de/), either of which would require adding a dependency
3. Write my own pretty printer, which entails a decent amount of complexity.

I've opted to go with the first option above as a starting point. In my testing, it has handled machine-generated XML with no extraneous whitespace well. Please let me know if another option would be more appropriate.