[Expat-discuss] Re: Expat 1.95.6 released

Fred L. Drake, Jr. fdrake at acm.org
Tue Jan 28 10:20:48 EST 2003


Carlos Pereira writes:
 > Many thanks for your work on Expat!

You're welcome!

 > >The following changes have been made
 > >since the 1.95.5 release:
 > >- Added XML_FreeContentModel().
 > >- Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree().
 > 
 > Three questions:
 > 
 > - Are there API changes, incompatible with 1.95.2?
 > (a given function does not work anymore)

I don't think we've introduced any real incompatibilities since then;
if so, it should probably be considered a bug.

The one thing that you might want to be careful about are the
functions XML_Parse(), XML_ParseBuffer(), XML_SetEncoding(), and
XML_SetBase() functions.  These all were defined to return the integer
0 to indicate failure and a non-zero to indicate success.  This
changed slightly in 1.95.4.  Starting in that version, Expat uses
values defined by the XML_Status enum.  For client code, there's no
immediate change, but we strongly recommend testing the return values
against the XML_STATUS_OK and XML_STATUS_ERROR constants instead of
treating them as booleans; some possible routes of API evolution may
introduce additional values into this enumeration.

In practice, Expat 1.95.x has alwas returned one of these two values
(and earlier versions may have, I just haven't checked those), but
documented them as booleans.  It is safe to convert any code that uses
1.95.x to use the defined values, if you ensure that they are defined
in the client code.  You can use this to define them in the
application:

#ifndef XML_STATUS_OK
#define XML_STATUS_OK    1
#define XML_STATUS_ERROR 0
#endif

The documentation reflects the current version of the interface; it's
likely that some additional documentation is needed to help people
migrate.  I've filed an issue for this and assigned it to myself:

http://sourceforge.net/tracker/index.php?func=detail&aid=676131&group_id=10127&atid=110127

 > - Are there API changes, that represent improvements over 1.95.2?
 > (a given function works but there are better ways to do it)

There is a handful of new functions; these are all documented in
doc/reference.html, included with the source distribution
(Doc\reference.html in the Windows installation).

 > - The Expat manual was updated to document the relevant API changes?

The manual (doc/reference.html) includes information on the current
API.  It does not include the API history.  For that, review the
comments in the file "Changes" ("Changes.txt" if you used the Windows
installer).


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



More information about the Expat-discuss mailing list