[Expat-discuss] Empty Tags

Karl Waclawek karl@waclawek.net
Fri Nov 15 16:37:16 2002



> I think what I'm going to end up doing is going with DOM instead of SAX
> style processing.  This will work ok for my app because the XML doesn't get
> too large.
> 
> Life would be easier if expat would have an optional mode that, when
> enabled, would cause the characterdatahandler to be called with NULL data
> and length set to zero when tags are empty.

Just wrap the end element handler. That is, Expat calls your wrapper handler,
this one in turn checks if the element is empty, and if yes, it calls
the application's character handler before it calls the application's
end element handler.

Karl




More information about the Expat-discuss mailing list