Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use TextWrangler to clean-up / tidy messy XML?

Tags:

xml

I don't need it to validate ( though that would be nice I don't think text wrangler does this) but to clean up messy .xml.

example this ...

<some><foo>
bar</foo></some>

to ...

<some>
   <foo>bar</foo>
</some>

thanks -MW

like image 471
MW. Avatar asked Jun 10 '10 20:06

MW.


1 Answers

If you're after a tool, most editors have some sort of "Tidy" feature.

  • In NotePad++: TestFX -> TestFX HTML Tidy -> Tidy: Reindent XML
  • In Visual Studio: Ctrl-K, Ctrl-D (or Edit -> Advanced -> Format Document)

A quick google for TextWrangler turns up this - http://magp.ie/2010/02/15/format-xml-with-textwrangler/

like image 135
Reddog Avatar answered Nov 17 '22 18:11

Reddog