Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FASTEST XML DELPHI parser?

443 views
Skip to first unread message

rob...@dellapasqua.com_nospam

unread,
Apr 29, 2002, 5:21:07 AM4/29/02
to
please,

can someone has completed the (previously speaked into this news) speed
benchmark of XML opensource parsers?

Or please can someone already has a report of parser speed, so to me
indicate the fastest component to use?

Really TNX, please post to my email (only if you like).

Again regards,

Roberto.


Karl Waclawek

unread,
Apr 29, 2002, 9:21:29 AM4/29/02
to

"Rob...@dellapasqua.com" <rob...@dellapasqua.com_nospam> wrote in message news:3ccd1163_1@dnews...

> please,
>
> can someone has completed the (previously speaked into this news) speed
> benchmark of XML opensource parsers?

Fastest OpenSource is probably Expat, but it is not written in Delphi.

Karl


Christian Charette

unread,
Apr 29, 2002, 11:24:53 AM4/29/02
to
> Fastest OpenSource is probably Expat, but it is not written in Delphi.
and in Delphi?

C.


Karl Waclawek

unread,
Apr 29, 2002, 1:36:18 PM4/29/02
to

"Christian Charette" <charetc@removeme_nbnet.nb.ca> wrote in message news:3ccd65c8$1_1@dnews...

> > Fastest OpenSource is probably Expat, but it is not written in Delphi.
> and in Delphi?

Maybe AElfred: http://xml.defined.net/SAX/aelfred2/
Ask Jeff Rafter if he has a new version you can test.

Karl

Uwe Fechner

unread,
Apr 29, 2002, 4:33:23 PM4/29/02
to
Hello Roberto,

the fastest DOM2 compliant XML-parser for delphi is the libxml2 based
dom implementation from the IDOM2 project.

The dom layer is implemented in object pascal, but parsing is done by
the underlying C engine.

It's about twice as fast as xerxes, and has many more features than
expat. Compared to msxml, you have about the same speed for parsing
documents, and some tests, like treewalking, are three times as fast.

It is validating, supports dtd's, xpath and xslt, and soon it will
offer schema support, too.

A setup program is under development (in the moment you have to install
four packages seperatly).

Give it a try:

http://sourceforge.net/projects/idom2-pas/

Regards:

Uwe Fechner

Karl Waclawek

unread,
Apr 29, 2002, 5:03:35 PM4/29/02
to

"Uwe Fechner" <ufec...@csi.com> wrote in message news:3CCDAE13...@csi.com...

> Hello Roberto,
>
> the fastest DOM2 compliant XML-parser for delphi is the libxml2 based
> dom implementation from the IDOM2 project.

If speed is important, then a SAX interface should be used.

Is there a SAX interface too? If yes, is it compatible with SAX for Pascal?

Karl


Christophe Espern

unread,
Apr 29, 2002, 6:45:04 PM4/29/02
to
Hello

>Is there a SAX interface too? If yes, is it compatible with SAX for Pascal?


Jeff Rafter has had Sax for Pascal Support to Sablopas. Sablopas is an OP
wrapper for Sablotron.

http://www.tekool.com/sablopas


Stig Johansen

unread,
Apr 29, 2002, 11:24:38 PM4/29/02
to
Uwe Fechner wrote:

> the fastest DOM2 compliant XML-parser for delphi is the libxml2 based
> dom implementation from the IDOM2 project.

Any possibility in the future, that it can coexist with Borlands default
parser?


--
Med venlig hilsen / Best regards
Stig Johansen
stig.j...@udvikling.it.dk
(remove dot dk)

Uwe Fechner

unread,
Apr 30, 2002, 3:35:08 AM4/30/02
to Stig Johansen
Stig Johansen wrote:
> Uwe Fechner wrote:
>
>
>>the fastest DOM2 compliant XML-parser for delphi is the libxml2 based
>>dom implementation from the IDOM2 project.
>
>
> Any possibility in the future, that it can coexist with Borlands default
> parser?
>
>

I suppose, you mean msxml combined with with xmldom.pas with the
phrase "borland default parser".

To a far extend it is already compatible with borland:

Just write:

uses idom2, idom2_ext, libxmldom;

instead of

uses xmldom;

And with our units, you can still switch between msxml and libxml2
and runtime.

Here:

http://sourceforge.net/projects/idom2-pas/

you find a guide, how to convert your programs, if you used xmldom before.

I first wrote libxmldom as an implementation of the interfaces, defined
in xmldom.pas from Borland, but because Borland didn't give us the
permission, to publish this interface unit under an open source license,
we switched to the interface-unit idom2.pas from Martijn Brinkers.

It is pretty much the same, we only moved the microsoft specific stuff
to the unit idom2_ext, tried to avoid some bugs in the borland unit,
and tried to keep closer to the standart as defined by w3c.org.

And idom2.pas defines some interfaces, that make it easear, to port
programs from java to delphi.

If you want to change libxmldom.pas in a way, that it implements the
interfaces, as defined in xmldom.pas, you could do it yourself within
an hour.

Well, one thing is still missing, and that is the nice little component
TDomDocument.

We don't use this component ourself, so I don't know, wether it is
compatible to idom2.pas, but we would be very happy, if someone finds
the time, to write a similar open source component for idom2.pas.

We would be happy for any help, to add an sax interface to this parser,
too. Libxml2 offers some (limited) sax functions, but because I don't
have any experience with sax myself, it is difficult for me, to write
a wrapper, that offers proper delphi interfaces to these libxml2 sax
functions.

Best regards:

Uwe Fechner

Uwe Fechner

unread,
Apr 30, 2002, 3:42:26 AM4/30/02
to

It is not, but I would like to write one. Libxml2 offers some limited
SAX fuctions, and it would be nice to be able to access them. Because I
don't have any experience with SAX, it is a little bit difficult for me.

If someone would help me, I would try to do it.

Best regards:

Uwe Fechner

Uwe Fechner

unread,
Apr 30, 2002, 3:47:23 AM4/30/02
to
Stig Johansen wrote:
> Uwe Fechner wrote:
>
>
>>the fastest DOM2 compliant XML-parser for delphi is the libxml2 based
>>dom implementation from the IDOM2 project.
>
>
> Any possibility in the future, that it can coexist with Borlands default
> parser?
>
>

I suppose, you mean msxml combined with with xmldom.pas with the

Just write:

uses idom2, idom2_ext, libxmldom;

instead of

uses xmldom;

Here:

http://sourceforge.net/projects/idom2-pas/

TXMLDocument.

Uwe Fechner

unread,
Apr 30, 2002, 3:44:01 AM4/30/02
to

It is not, but I would like to write one. Libxml2 offers some limited
SAX functions, and it would be nice to be able to access them. Because I

Uwe Fechner

unread,
Apr 30, 2002, 5:25:52 AM4/30/02
to
Sorry,

I submitted the wrong URL for the user guide.

Here:

http://sourceforge.net/docman/display_doc.php?docid=10387&group_id=46835

is the corrected link.

Regards:

Uwe

Stig Johansen

unread,
Apr 30, 2002, 10:32:06 AM4/30/02
to
Uwe Fechner wrote:

> I suppose, you mean msxml combined with with xmldom.pas with the
> phrase "borland default parser".

Exactly, and underneath msxml on M$ windows, and OpenXML on Linux.

> To a far extend it is already compatible with borland:
> Just write:
> uses idom2, idom2_ext, libxmldom;
> instead of
> uses xmldom;

Yes, but I cannot get the Borland SOAP implementation to work without the
xmldom and underlying oxml/msxml. Therefore I need to use both xmldom and
libxmldom.

> And with our units, you can still switch between msxml and libxml2
> and runtime.

Well, I am primarily talking about switching between OpenXML and libxml2.

> I first wrote libxmldom as an implementation of the interfaces, defined
> in xmldom.pas from Borland, but because Borland didn't give us the
> permission, to publish this interface unit under an open source license,

What a pitty, things could be so easy if this interface was published.

> It is pretty much the same, we only moved the microsoft specific stuff
> to the unit idom2_ext, tried to avoid some bugs in the borland unit,

Interesting, is it possible to elaborate?

> If you want to change libxmldom.pas in a way, that it implements the
> interfaces, as defined in xmldom.pas, you could do it yourself within
> an hour.

Since my previous post, I invested some time to try to get it to work.

My problem here (On the linux side) is, that I need to transform XML using
XSL. This is NOT supported by the OpenXML, which is included in the K2 ent.

I had previously succeded using sablotron (sablotxmldom.pas).

If I use idom2, I had some conflicts, since some of the names is the same as
defined in xmldom from Borland.

Today, I WANTED to get idom2 to work, at least to do a transform. I managed
to get it to work.

Basically, I changed the libxmldom to use the xmldom instead of idom2. Apart
from this, I created a new unit, idom2_diff, which contains the differences
used by libxmldom.

Furthermore, I changed idom2_ext to use xmldom instead of idom2, and deleted
some stuff, that was defined in xmldom.

So the issue by having libxml coexist with 'Borland default' is solved by
doing this. So basically, I think it is just to 'reorganize' the units.

For the time being, I would suggest that you reorganize the units, so it is
possible for everybody to use libxml2 as well as 'xmldom'.

As mentioned above, I have a working solution, but only how to use libxml2
as well as xmldom. I would like to publish the parts of the units I use
when I get the time (Hopefully within a day or two).

Jeff Rafter

unread,
Apr 30, 2002, 11:49:27 PM4/30/02
to
> can someone has completed the (previously speaked into this news) speed
> benchmark of XML opensource parsers?

I haven't tested speed on libxml yet, but in my tests Expat was eons
faster... this was because most parsers in Delphi use strings rather than
PChars/PWideChars. Karl has also written a wrapper for MSXML in "buffered"
mode which was very fast. Finally Stefan Heymann has a parser at
destructor.de that is very fast (and native Pascal) although it does not yet
implement DOM or SAX.

http://xml.defined.net/parsers.xml

It might be a good idea to add speed results to the document... anyone
interested in coming up with some results? I would be happy to post them...

Cheers,

--
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting

0 new messages