feet
Start | Guestbook | News | Contact
johannes-gruber.net
"The world through a lens"
mainMenu

XML Tidy

Introduction

This tool cleans up your xml file and intends the lines for better reading. Especially automatically generated xml files are hard to read and it takes a lot of time to format them. For this reason I wrote this litte tool.

Source file:
<tag1><tag2><tag3 att1="attValue1" /></tag2><tag4>value4</tag4></tag1>


The result looks like:
<tag1>
  <tag2>
    <tag3 att1="attValue1" />
  </tag2>
  <tag4>value4</tag4>
</tag1>

Usage

Prerequisite: Java 1.5 or higher
Usage of the command line version:
xmlTidy.bat <mySource.xml> <myDestination.xml> TAB|space

mySource.xml........unformatted xml file. This is a mandatory parameter!
myDestination.xml...file which contains the formatted xml content. This parameter is optional.
TAB|space.................the third parameter can be the word TAB or some blank between quotes. They are used as indentation characters. If this parameter is not used, 2 spaces are used.

Examples:
- xmlTidy.bat mySourceFile.xml
- xmlTidy.bat mySourceFile.xml myDestinationFile TAB
- xmlTidy.bat mySourceFile.xml myDestinationFile " "

Download

XML Tidy v1.0 DOWNLOAD - CDATA is processed correctly
- XML tags which contain content and another children are processed correctly
- Intendation string can be a tab as well
2007-04-21
XML Tidy UI v1.0 DOWNLOAD - GUI for XML Tidy v1.0
- Executeable jar file - start it like a normal .exe file or execute "java -jar xmlTidyUI.jar" in a command shell
2007-04-21

Miscellaneous

I have not tested this tool with HTML pages. Actually they are supposed to be XML pages as well but usually they have some separate treatments.
If you find any errors I would appreciate you sending me the xml string which could not be formatted well (please use the web form). I will try to find a solution for it as soon as possible.

This tool is for free. Primarily I wrote it because I was annoyed about endless xml strings after processing them with an xml processor. I hope it can help you as well. If you like it or hate it or you were just curious if it works, I am looking forward for an entry in my guestbook - that is the price :-)