Prettify XML text in BBEdit
April 12, 2011
Applications | Web Building | XML

When XML data is sent back from a web service, it is in the form of a stream: there are no line breaks or indents to make it easier for humans to read. The example below is typical: the entire XML result is one continuous line. This makes it very hard to troubleshoot your application: you need a utility to put the indents and line-breaks back in.

Screen shot 2011-04-11 at 4.48.48 PM.jpg

Ads by Google

Posted by ellen at April 12, 2011 11:36 AM

Many users of BBEdit may not be aware that it has cleanup functions that will rapidly reformat HTML and XML code into a more legible structure.  Here's how to get to them:

Select "Tidy" from the Markup menu in BBEdit. Click on Reflow Document.


The default selections are probably OK, but you may want to check off the indenting options for block-level tags and attributes.

Screen shot 2011-04-11 at 4.48.20 PM.jpg

Click Reflow, and you should see something similar to the result shown here. Much easier to read!

Screen shot 2011-04-11 at 4.48.34 PM.jpg


Ads by Google

Ads by Google

 RSS   |   Contact Me

Ads by Google