Working With HTML Tidy Tool

HTML Tidy, a tool created by David Raggett converts HTML documents into clean XHTML in a matter of seconds. In the beginning, it was designed to clean up HTML markup. Now, Tidy is included as a plug-in with most big-time HTML editors. In addition, Tidy comes in a version you can run from the command prompt and a GUI version ( Tidy GUI) .


_______________________________________________


You may be wondering just what Tidy can do. Well, it pretty much does everything you need it to do. For example, Tidy corrects the following:

Detects mismatched end tags - In most cases, Tidy will locate mismatched end tags and make the appropriate corrections.

Corrects incorrectly nested elements - In most cases, Tidy will correct nesting errors.

Locates misplaced elements - Tidy will alert the document author if an element is misused-for example, if the td element is nested within a form element.

Lowercases element and attribute names - Tidy will correct any uppercase element names and attribute names automatically.

Adds quotation marks around all attribute values - Tidy will add double or single quotation marks around all attribute values ( you can specify which).

This is not the end of what Tidy can do. In fact, you can customize Tidy to do just about anything relating to the conversion process. For example, you can control whether the modified version uses indentation for nested elements, or you can request that Tidy invoke only some, but not all, of the rules. To learn more about HTML Tidy’s many abilities and options.

Using Tidy GUI

Many of you might not be inspired by the command prompt. In fact, you may want to run from it. There are also some of you who won’t want to download another text editor. If you’re interested in using a GUI interface for Tidy but don’t want a full text editor attached, andre Blavier created a version that you just might get along with.

You simply browse for the file you want to Tidy by clicking the Browse button and the click the Tidy! button. After that, you click the show Output button and save the Tidied output to a new document to save it as your own.

Using Tidy from the Windows Command Prompt

If you remember the days of DOS, you may be comfortable using tidy as a stand-alone tool at the command prompt. Windows users who are uncomfortable working form the MS-DOS prompt.

Before we get started with this mini tutorial, download the DOS version of HTML TIDY from the WEB.

Ø To fire up the DOS prompt, select Start - Programs – command Prompt or Ms-DOS Prompt, depending on your version of windows. (You might need to go to Start – Programs –Accessories - Command Prompt or MSDOS Prompt). A windows with a black background and text, C:> appears.

Ø Locate the tidy.exe file. If you saved it in its own folder, Tidy, you can navigate to that folders using the following command:

Cd …\tidy

The command says the following:

Cd tells the processor that you’re changing the folders. You should follow this command with a white – Space character.

..\ Navigates up one level to the root folder.

Tidy Opens the Tidy folder.

Once you’ve navigate to the Tidy folder, you’re ready to use the tool. Tidy allows you to point to an HTML document and use commands to convert the document. To do this, you need an HTML document to work with. We’ll assume the document to be converted has a filename of sloppy.htm.

To convert your document to XHTML using Tidy, type the following command at the Windows command prompt:

Tidy –ashtml –m c:\XHTML\sloppy.htm

 



_______________________________________________

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________




FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.