Tidy-ing your XML, HTML

If you ever wonder how would you get your messy XML and HTML well-formatted, Here is the whizard, Tidy tidy is a small but very effective tool written by Dave Raggett.

Tidy can clean, indent XML and HTML data very effectively.

tidy -mi -xml file-name

Download the tool, and place the tool in your PATH, so that it can be directly used. Then you can use the tool very effectively.


If you see the screenshot of my vim editor, you'll see we can use Vi's shell command and tidy to modify the file and indent it

The parameters that you see are

  • m modify the file
  • i indent the file
  • xml the input file is XML file

You can exclude the xml parameter if you want to tidy a XHTML or HTML file.

This is not the only thing that Tidy can do, but it will find out errors and warnings in your HTML or XML page.

Thanks! Tidy


4 Responses to “Tidy-ing your XML, HTML”

  1. jared Says:

    That code just emptied the xml file πŸ˜›
    One thing is for sure, the file is not messy anymore. I was left with only two tags: <xml

  2. tomazeli Says:

    thanks dude… πŸ™‚

  3. Sakahayang Kang Asep Says:

    thankyou bro for your share,,,
    I like it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: