Re: TidyATL help?

Cory Nelson <[email protected]>
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
I am asking some people I know but it's looking like pinning a
delegate is only possible in .NET 2.0.

COM is viable on Windows but a pure managed wrapper would make it
possible to run on *nix with Mono.

Wrapping the structures isn't that troublesome.  I'm not aiming to
wrap all of Tidy, just document parsing/fixing/saving, reporting, and
stepping through the nodes/attributes which only requires
TidyInputSource and TidyOutputSink for parsing/saving Streams.


On Thu, 04 Nov 2004 08:45:14 -0500, Charles Reitzel <[email protected]> wrote:
> Hi Cory,
> 
> I assume you are talking about a .NET wrapper.  Sorry, I can't be of any
> help pinning down a delegate.  My understanding is that one of the point of
> the Delegate mechanism was to avoid this exact issue.  Also, hasn't
> Delegate handling has evolved some in later .NET/CLR releases?
> 
> I did a bunch of reading on the COM Interop (vs. other techniques) at the
> time.  In fact, I wrote a few .NET wrappers.  My problem was that I am too
> lazy to maintain the complete interface to match tidy.h.   I tried very
> hard to define Tidy data structures as managed or, alternately, as
> non-managed but addressable by the CLR.  You can't get there from
> here.  You need to redefine all public Tidy data structures for .NET to be
> binary compatible w/ C.  Pain in the neck.
> 
> With the COM wrapper, I simply #include tidy headers into the MIDL
> file.  The COM-to-.NET compiler translates the MIDL file to a .NET
> assembly.  It even gets the names right.  Better still, the call interface
> is all but identical.
> 
> Btw, the COM automation overhead is trivial.  In general, the parameter
> marshalling issues are similar for COM and .NET (or Perl or Java, for that
> matter).  The COM-to-.NET compiler does a good job of "impedance matching",
> meaning the overhead amounts to an extra layer in the call stack, but no
> additional data translation work.
> 
> Turns out the big overhead is string translation.  COM/.NET/Java all use
> Unicode, all the time.  When parsing or emitting string data, minimal
> overhead can be achieved by forcing TidyLib to use UTF16LE (this is
> Windows) character encoding.  Thus, the marshalling layer need not
> constantly convert the character streams.  When reading or writing files,
> the language-specific character encoding does enter into it.
> 
> 
> 
> take it easy,
> Charlie
> 
> At 06:20 AM 11/3/2004 -0800, Cory Nelson wrote:
> >I'm writing a P/Invoking (no COM overhead) wrapper, havn't ran into
> >any trouble with using the callbacks in TidyBuffer and TidyInputSource
> >(yet).
> >
> >Gimme a few days to finish it up and make sure everything works, I'll
> >put the code up somewhere.
> >
> >
> >On Wed, 03 Nov 2004 08:52:38 -0500, Charles Reitzel <[email protected]>
> >wrote:
> > > Hi Corey,
> > >
> > > My TidyLib .NET wrapper just uses the built-in "COM interop" mechanism over
> > > the COM interface.  After doing some research, I found MS uses this
> > > mechanism for several of their own products (e.g. Office).  Thus, it
> > > actually works fairly well.  Briefly put, COM type libraries have similar
> > > metadata to .NET assemblies.  VS.NET supplies, in essence, a COM-to-.NET
> > > compiler.
> > >
> > > Anyway, Andy specifically wants to use the COM wrapper.  A reasonable
> > > substitute might be to get the Perl wrapper to work w/ your DLLs.  Once
> > > that works, the same changes might work for COM.
> > >
> > > The fun bit for any of these wrappers is in the error handling.  Note, the
> > > COM wrapper supports implementation of a TidyReportFilter in any COM
> > > language.  This applies to .NET as well.  It is actually very difficult to
> > > implement "call forwarding" (calling out from native code into managed
> > > code) from scratch.  This is difficult for all scripting languages
> > > (including interpreted languages like Java and .NET).  See the SWIG
> > > developer list for more background.  www.swig.org.
> > >
> > > take it easy,
> > > Charlie
> > >
> > >
> > >
> > > At 12:45 AM 11/3/2004 -0800, Cory Nelson wrote:
> > > >I have no experience with COM but I'll work on a .NET wrapper.
> > > >
> > > >
> > > >On Tue, 02 Nov 2004 06:37:08 -0500, Charles Reitzel <[email protected]>
> > > >wrote:
> > > > > Hi All,
> > > > >
> > > > > If it helps, the full source is available here:
> > > > >         http://sourceforge.net/projects/tidywrap
> > > > >
> > > > > I have just not had time to keep up w/ these wrappers.  Due to
> > changes, the
> > > > > COM (and thus, .NET wrapper) is no longer compatible w/ the current
> > > > > TidyLib.  It would be great if someone could get the wrappers to
> > work with
> > > > > dynamic builds.  E.g. Corey Nelson's DLL builds for the COM wrapper.
> > > > >
> > > > > I am available to answer any questions that may arise.
> > > > >
> > > > > hth,
> > > > > Charlie
> > > > >
> > > > >
> > > > >
> > > > > At 12:44 AM 10/29/2004 -0400, Andrew Herron wrote:
> > > > > >Well since I haven't had any bites yet how does this sound:
> > > > > >
> > > > > >My company is willing to pay for this.
> > > > > >
> > > > > >If anyone is interested send me a quote over the weekend; on Monday we
> > > > > >are going to put it up for grabs on www.rentacoder.com or similar.
> > > > > >
> > > > > >Ideally I want to contribute the updated TidyATL code back to this
> > > > > >project, and if someone who doesn't know the Tidy code gets a hold
> > of it
> > > > > >there is no telling what the final code will look like.
> > > > > >
> > > > > >
> > > > > >Cheers,
> > > > > >Andy
> > > > > >
> > > > > >-----Original Message-----
> > > > > >From: [email protected]
> > > > > >[mailto:[email protected]] On Behalf Of Andrew
> > > > > >Herron
> > > > > >Sent: Tuesday, 12 October 2004 11:06 AM
> > > > > >To: [email protected]
> > > > > >Subject: [Tidy-dev] TidyATL help?
> > > > > >
> > > > > >Hi,
> > > > > >
> > > > > >I'm having some problems with TidyATL (Charlie's COM wrapper).  I'm
> > > > > >trying to replace TidyCOM (the Aug 00 COM wrapper) and there are a few
> > > > > >regressions as well as what appears to be bugs in the wrapper itself.
> > > > > >
> > > > > >To simplify things I have made up 7 tests written in VB6.  SF is
> > > > > >blocking zip attachments so you'll have to grab it from the web:
> > > > > >http://www.ephox.com/tidy/tidyatl.zip
> > > > > >
> > > > > >The biggest problem IMO is the lack of character set support; the 5
> > > > > >regressions may or may not exist in the latest tidylib.
> > > > > >
> > > > > >I spoke to Charlie about this a few months back and he said:
> > > > > >"I am thinking I want to make all of my wrappers run over Corey
> > Nelson's
> > > > > >DLL builds.  This way folks can take advantage of new TidyLib builds
> > > > > >without having to update HTML::Tidy, TidyATL, TidyUI, etc."
> > > > > >
> > > > > >However Charlie is too busy to work on this right now and I need
> > to fix
> > > > > >these problems by the end of October.  Can anyone else help me out
> > with
> > > > > >this?  My knowledge of C++ is severely lacking.
> > > > > >
> > > > > >
> > > > > >The TidyATL page:
> > > > > >http://users.rcn.com/creitzel/tidy.html#comatl
> > > > > >
> > > > > >Source code:
> > > > > >http://sourceforge.net/projects/tidywrap
> > > > > >
> > > > > >
> > > > > >Cheers,
> > > > > >Andy
> > > > > >
> > > > > >
> > > > > >
> > > > > >-------------------------------------------------------
> > > > > >This Newsletter Sponsored by: Macrovision
> > > > > >For reliable Linux application installations, use the industry's
> > leading
> > > > > >setup authoring tool, InstallShield X. Learn more and evaluate
> > > > > >today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/
> > > > > >_______________________________________________
> > > > > >Tidy-develop mailing list
> > > > > >[email protected]
> > > > > >https://lists.sourceforge.net/lists/listinfo/tidy-develop
> > > > >
> > > > >
> > > > > "It's true that I've driven through a number of red lights on
> > > > > occasion.  But on the other hand, I've stopped at a lot of green
> > ones but
> > > > > never gotten credit for it."
> > > > >
> > > > > - Glenn Gould
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by:
> > > > > Sybase ASE Linux Express Edition - download now for FREE
> > > > > LinuxWorld Reader's Choice Award Winner for best database on Linux.
> > > > > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Tidy-develop mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/tidy-develop
> > > > >
> > > >
> > > >
> > > >--
> > > >Cory Nelson
> > > >http://www.int64.org
> > > >
> > > >
> > > >-------------------------------------------------------
> > >
> > >
> > > >This SF.Net email is sponsored by:
> > > >Sybase ASE Linux Express Edition - download now for FREE
> > > >LinuxWorld Reader's Choice Award Winner for best database on Linux.
> > > >http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> > > >_______________________________________________
> > > >Tidy-develop mailing list
> > > >[email protected]
> > > >https://lists.sourceforge.net/lists/listinfo/tidy-develop
> > >
> > > "It's true that I've driven through a number of red lights on
> > > occasion.  But on the other hand, I've stopped at a lot of green ones but
> > > never gotten credit for it."
> > >
> > > - Glenn Gould
> > >
> > >
> >
> >
> >--
> >Cory Nelson
> >http://www.int64.org
> >
> >
> >-------------------------------------------------------
> 
> 
> >This SF.Net email is sponsored by:
> >Sybase ASE Linux Express Edition - download now for FREE
> >LinuxWorld Reader's Choice Award Winner for best database on Linux.
> >http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> >_______________________________________________
> >Tidy-develop mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/tidy-develop
> 
> "It's true that I've driven through a number of red lights on
> occasion.  But on the other hand, I've stopped at a lot of green ones but
> never gotten credit for it."
> 
> - Glenn Gould
> 
> 


-- 
Cory Nelson
http://www.int64.org


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.