[Interest] [ANN] libstudxml - modern XML API for C++

Boris Kolpackov boris at codesynthesis.com
Wed May 21 23:08:54 CEST 2014

Hi Constantin,

Constantin Makshin <cmakshin at gmail.com> writes:

> 1) your words about libstudxml being free from external dependencies
> contradict with the fact that actual parsing is done by Expat. Packaging
> two libraries together doesn't make Expat "internal" dependency;

We can argue about the semantics, but from the practical point of
view (and from the user's point of view) the library is external
dependency free. If you download the source, you don't need to
have Expat already installed somewhere. You just do 'configure'
and 'make' or open VC++ project and build. The result is a single
libstudxml library.

Now, if you are, say, a package maintainer for some distribution
(e.g., Debian or Fedora), then you can pass the --with-external-expat
configure option and build libstudxml to use Expat that is already
part of the system. Still, from the user's perspective and practically,
this doesn't change anything (Expat is already installed on probably
99.99% of Linux boxes out there).

> 2) looks like the high-level parser will blow up, throwing an exception,
> if the input doesn't completely satisfies all of the application's
> expectations. Making so strict requirements to the order of child
> elements is a questionable idea IMHO (unless they [can] contain
> references to each other, of course).

It is up to the application to specify how strict it wants to be
about the input. The parser doesn't make any assumptions, it just
provides you with the mechanisms to enforce such expectations without
writing to0 much boilerplate code. To make a concrete example, you
call next_expect() to say that you are expecting to get a specific
event. If there is some other event instead, then the parser will
diagnose this for you (i.e., throw an appropriate exception) But
you can also call next() and deal with whatever event is returned
next in some more "relaxed" manner.

Thanks for the feedback.


More information about the Interest mailing list