views:

14967

answers:

13

Any online xml formatters? Ones that properly indent the tags.

Or any free Windows text editor which has a built-in xml formatter?

+2  A: 

Vim has an freely downloadable script which might serve your purpose. Oh, and it's a damned fine text editor, too!

You'll need "xmllint" in addition as for this as well.http://xmlsoft.org/xmllint.html
monojohnny
+1  A: 

My new favorite text editor under windows is jEdit. It has a plug-in based architecture, and I believe XML indentation requires a plug-in, but plug-in installation is a breeze. Check it out. It also does indentation and syntax highlighting for countless other languages.

PeterAllenWebb
+7  A: 

I use Visual Studio. No, I'm not joking. I'm not sure if it is in the Express-versions of Visual Studio and thus qualifies as free.

Pasting a XML-string into an XML-document under VS just indents it mighty fine. As needed by me sometimes :)

Leonidas
This isn't online, and VS is one of many that do this, it is way faster to format within the browser when working on webapplications.
kr
That's not online, and only runs on a crappy Windows.
Cristian
+1  A: 

My favourite freeware editor - PSPad - does that just fine. It even includes Tidy, so you can specify exactly how you want your XML to be formatted.

Teloah
+30  A: 

This should do the trick.

http://www.shell-tools.net/index.php?op=xml_format

kAra =>

kr
Looks to me like this is the only good answer to the original question. Thanks kAra.
MikeNereson
That did the trick, thanks!
Virat Kadaru
This one currently has a problem if you have encoded entities in your input. with this input: `<xml><someval>Test <code> value</someval></xml>`, the output includes the line `<someval>Test <code> value</someval>`. (Note that the `<` has been incorrectly decoded into `<`, resulting in an invalid document.
Kip
run escaped strings though this online tool to fix. This is a common problem with working with URLs and URL type datahttp://meyerweb.com/eric/tools/dencoder/
kr
+3  A: 

XML Notepad 2007

  • Tree View synchronized with Node Text View for quick editing of node names and values.

  • Incremental search (Ctrl+I) in both tree and text views, so as you type it navigates to matching nodes.

  • Cut/copy/paste with full namespace support.

  • Drag/drop support for easy manipulation of the tree, even across different instances of XML Notepad and from the file system.

  • Infinite undo/redo for all edit operations.

  • In place popup multi-line editing of large text node values.

  • Configurable fonts and colors via the options dialog.

  • Full find/replace dialog with support for regex and XPath.

  • Good performance on large XML documents, loading a 3mb document in about one second.

  • Instant XML schema validation while you edit with errors and warnings shown in the task list window.

  • Intellisense based on expected elements and attributes and enumerated simple type values.

  • Support for custom editors for date, dateTime and time datatypes and other types like color.

  • Handy nudge tool bar buttons for quick movement of nodes up and down the tree.

  • Inplace HTML viewer for processing xml-stylesheet processing instructions.

  • Built-in XML Diff tool.

  • Support for XInclude

  • Dynamic help from XSD annotations.

  • Goto definition to navigate includes and XSD schema information.

William Leara
+3  A: 

Online XML formatter http://x01.co.uk/tools/online-xml-formatter

alexeit
+10  A: 

I wrote one a while back for fun: http://aaronkarp.com/prettyXML/

Aaron
this is the only online one from this thread which worked perfectly for me, thanks!
dain
@Aaron: any chance you could put the output in an uneditable textarea? that would make it easier to select all without getting the page header too. thanks!
Kip
This is getting bookmarked. Thanks!
Thomas Sidoti
Unfortunately comments mess up the indentation...
thSoft
+4  A: 

Or you can use http://xmltoolbox.appspot.com

Its a free online xml formatter.

It has a few other features to.

  1. Search tags by tagname.
  2. Automatic xpath generator.

Greetings. Ole Bille. (Creator of the site.)

Ole Bille
A: 

http://xmltoolbox.appspot.com worked for me but most of the others had trouble dealing with inline comments.

jwan
+1  A: 

I just came across this post and thought someone may be interested. There is a silverlight xml formatter here at http://www.bytechaser.com/en/resources/tp9h7nivzr/free-online-xml-formatting-tool.aspx It can take a few seconds to load initially but all you do is paste in the xml and set the indentation. I use it for formatting SSIS config files.

Alex
+1  A: 

I use xmlindent

raticulin
A: 

please check this site. it not only has xml formatter also has json formatter. http://www.shell-tools.net/

ryanouyang