[Expat-discuss] Empty Tags

John Osborn john@osborntech.com
Fri Nov 15 16:53:02 2002


That will work.  Should have thought of that myself.  Thanks!

-----Original Message-----
From: Karl Waclawek [mailto:karl@waclawek.net]
Sent: Friday, November 15, 2002 10:37 AM
To: john@osborntech.com; expat-discuss@libexpat.org
Subject: Re: [Expat-discuss] Empty Tags




> 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