Categories
Other vi / vim X|HTML

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.

vim-tidy.png

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

By ruturajv

developer, traveler...

4 replies on “Tidy-ing your XML, HTML”

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
haha.

Leave a reply to ruturajv Cancel reply