Wiki Home

Tidy COM


Namespace: WIN_COM_API
Tidy COM is a COM Wrapper for HTMLTidy. Feed it questionable HTML and it will clean it up -- balance tags, properly sequence nested tags, normalize tags, and so forth.

[2001.07.10] Current version (1.2.6, 27 June 2001) is based on the 4th August 2000 version of HTML Tidy.

http://perso.wanadoo.fr/ablavier/TidyCOM/
Here's how you could use Tidy COM in VFP:

TidyObj = CreateObject("TidyCOM.TidyObject")
TidyObj.Options.Doctype = "strict"
TidyObj.Options.DropFontTags = .T.
TidyObj.Options.OutputXhtml = .T.
TidyObj.Options.Indent = 2  && AutoIndent
TidyObj.Options.TabSize = 8
TidyObj.TidyToFile( "bad.htm", "good.htm")

Or you could get output this way
cGoodHTML=TidyObj.TidyToMem("bad.htm")

Or you could configure Tidy with a configuration file:
TidyObj = CreateObject("TidyCOM.TidyObject")
TidyObj.Options.Load( "myconfig.txt")
TidyObj.TidyToFile( "bad.htm", "good.htm")

If you're into C++, the source code for Tidy COM is here: http://perso.wanadoo.fr/ablavier/TidyGUI/TidyWin32-src.zip
Category Web Development Category Third Party Products Category Tools
( Topic last updated: 2001.07.10 03:47:17 PM )