[Expat-discuss] Character Data

Vassilii Nemtchinov vnemchin@hotmail.com
Sun, 12 Aug 2001 02:40:12 +0000

I know that the subject of handling character data has been already 
discussed here. Still I would like somebody to provide some suggestions on 
the subject. Since we can not assume that the character data arrive in one 
chunk for various reasons, in my solution I am allocating a buffer in the 
start tag handler and I am also setting a flag indicating that I've 
encountered the beginning of the element. I keep adding character data to a 
buffer in the character handler until I reset back the flag in the end 
handler. I can see several problems in using this method. First, it seems 
that the whole purpose of event-driven parser has been defied since I have 
to set sentinels  myself and not rely entirely on the parser. Secondly, in 
the worst case I have to allocate as many sentinels as I have elements in 
the document (same goes for separate buffers for character data). I am sure 
that somebody found a better solution for getting character data.

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp