[Expat-discuss] Using Expat to rewrite an XML file, can it be done?

Karl Waclawek karl@waclawek.net
Fri, 20 Sep 2002 09:50:51 -0400


> About this answer I have a question:
> 
> I'm starting to write a program in C++ and I want to parse a XML 
> document to get some parameters.  Is it recommended to use something
> else than expat?  I mean, reading this answer I think I have to
> find something to mount on expat, other high-level layer.
> Is it that what you wanted to say?  Any suggestions?

Well, if you want to edit an XML file then a DOM parser looks
more like what you need. There are several available, like
Xerces and libXML.

If you just want to read data from the XML document and use them some
other way, than Expat should do just fine for the reading part.

If you want to adhere to a standardized API, like SAX, then
you need a wrapper that exposes Expat functionality 
(which is already SAX like) in a more strictly SAX way.

There is one link on the Expat home page for a SAX wrapper
written in C++. I don't know how widely used this specific
version of the SAX API is, in the C++ world, but here it is:

http://www.jezuk.co.uk/cgi-bin/view/arabica

There is another C++ wrapper too, but the link seems dead at the moment:

http://www.codeproject.com/soap/expatimpl.asp


Hope that helps,

Karl