On Mon, Jan 12, 2009 at 12:27:20PM +0100, Roan Kattouw wrote:
and because stripping indentation reduces the size of the output, saving bandwidth (it may not seem like much for one small request like this one, but for many and/or large requests, it certainly makes a difference).
It also saves a slight bit of CPU time, because the generating code doesnt have to track indentation levels or add the spaces for indenting.
If your desire for indented XML is for viewing of downloaded XML, just open your XML file in Firefox. For other purposes, you could look for an XML prettifier, which I'm sure has to be available somewhere.
You can throw one together easily enough in PHP, if your local PHP has the DOM extension enabled: Just load the API output into a new DOMDocument, set the formatOutput property to a true value, and save it. You should be able to do the same using the XML libraries in just about any other language.