Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-09-27 14:04:02


dietmar_kuehl_at_[hidden] wrote:
> ... and why do I want to reinvent the wheel rather than using
> Xerces, which is working after all, in the first place? Well, I was
> successful in using it but personally I consider it a pain. It uses
> idioms imported from some alien world which don't work too well in
> this alien world and work even less in C++. I used it quite a while
> ago but if I remember correctly, there were classes for lots of
> different things which aren't handled different at all. The overall
> interface to do simple things was, IMO, too complex: I want a simple
> interface to do simple things. This saves me the complex interface
> for complex things.

I'm also using Xerces (SAX) at work for XML parsing, because it's
about the only XML parser currently available for C++. I'm also
having some pain with it.
The "callbacks by overloading virtual functions" approach doesn't
bother me too much (although exploring an iterator-based approach
would definitely be interesting). However:

 - The documentation is scarce, it's a javadoc-like format, but
doesn't even document all classes. And it appears to be lacking
some necessary detail.

 - It doesn't use the standard library code conversion facilities,
but invents its own. I've managed to segfault the library while
trying to use these facilities in what I believe is the most
obvious way, and neither me nor a colleague can see a problem with
my code.

 - There are factories and class hierarchies with virtual functions
all over where they are not necessary, in my opinion. I believe
everybody will choose an XML parser and its possible optional
component alternatives at compile-time, not at run-time, so virtual
functions are not necessary.

 - It's not templated, so every callback gets some strange
"XMLCh*" for a string (about the same than a wchar_t*, but
apparently an "unsigned short*" even on Solaris :-(. This requires
manual conversion to an easily usable 8bit char. A templated
approach looks much more flexible here.

 - Some more remnants of the SAX Java interface prevailed; a major
clean-up in terms of number of interface classes appears to be
in order.

 - The validator (against a DTD) appears to work fine.

Jens Maurer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk