Re: Use TidyCOM in ASP?

I have a simple COM wrapper for libtidy.  It is pretty rough.  I haven't 
had time to give it any polish, but it is re-entrant (free threaded in COM 
terms).  I used ATL instead of MFC, so it is small and lightweight.

The API is the same as my C++ wrapper - which is pretty much the same as 
the C lib with object notation.

You can pull it from my Tidy page at:
http://users.rcn.com/creitzel/tidy.html

Get back to me on the dev list at
<tidy-develop@lists.sourceforge.net> with any bugs, questions, etc.

Sorry it took so long, Jelks!

And, no, the original TidyCOM shares the original Tidy's lack of 
re-entrancy.  That said, like libtidy, my ATL wrapper does no 
synchronization.  That is up to you.  My suggestion is to keep TidyDocument 
objects local.  I.e. create and destory them as needed.  The objection 
instantiation cost has been kept low - far below the cost of parsing and 
formatting (the largest part of which is I/O).  Thus it is cheaper to just 
create and destroy local variables than it is to synchronize access to 
shared objects.  No synchronization necessary!

take it easy,
Charlie



At 05:33 PM 9/8/2002 -0400, Wade Leftwich wrote:

>Hello,
>
>I am looking at using TidyCOM in an ASP application, to clean up HTML that
>users type into a textarea.
>
>On the TidyCOM home page (http://perso.wanadoo.fr/ablavier/TidyCOM/ ), I find
>this warning:
>"""
>Warning: TidyCOM's code is not re-entrant--no more than 1 instance of
>TidyObject should be alive at the same time in the same process.
>"""
>
>Pardon my ignorance about ASP (I'm more of a Zope person), but does this mean
>only one TidyObject may exist in the entire ASP application? If that's the
>case, I guess I have to do a queue-and-mutex thing.
>
>Any advice or recommendations of alternatives appreciated.
>
>
>Wade Leftwich
>Ithaca, NY

Received on Monday, 9 September 2002 10:58:17 UTC