Re: [xml] Delphi bindings for libxml2


Eric Zurcher csiro au wrote:
Hello all,

It is now almost exactly 2 years since the last update of Petr Kozelka's Pascal units for accessing libxml2 
and libxslt(available at Those units corresponded to release 
2.5.10 of libxml2. Since then, there have been a number of significant additions to the libxml2 API, such as 
the addition of the SAX2 parser.

I make extensive use of libxml2 in several of my Delphi applications, and wanted to be able to make use of the faster SAX2 code, so I thought I'd try updating the bindings on my own. I first tried using h2pas, but found that it didn't work as well as I had hoped (perhaps a result of my inexperience in its use). As an alternative, I put together an XSLT transformation to generate the bindings from libxml2-api.xml (and its libxslt counterparts), rather than from the *.h files. This approach seems to have worked well, with the output of the transformation requiring only a tiny bit of manual editing.

This is good to hear! Will the bindings be Kylix compatible as well?
Will it follow the namings used in Libxml2-pas? E.g. the "PxmlChar"?

By the way, we realized that mapping the memory functions to use the
Delphi memory-manager in the initialization part of the libxml2.pas
unit is not adviseable, since if using DLLs every DLLs will overwrite
the previous mapping, resulting in the function pointers being invalid
for all DLLs when the last DLL which mapped is unloaded.

I have tried several times to contact Petr to see whether he would like to incorporate my binding into his libxml2-pas project on sourceforge, but I have received no response from him. I am writing now to see whether anyone else is interested this code, or in providing a "home" for it so that it can be distributed (preferably under the terms of the MIT license) to any who wish to use it.

We are definitely interested in the code :-)

Thanks & Regards,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]