The start method had to be changed to work properly. If
some dataRead returned a length of data read below the
buffer size, the start method has interpreted this as
being at the end of the file, which is completly wrong.
Changed it to the comparison against a returned length
of 0 which indicates "nothing read".
- start
{
for (;;) {
int bytes_read, done;
void *buff = XML_GetBuffer(parser, bufsize);
if (buff == NULL)
[self errorHandler:XML_GetErrorCode(parser)];
bytes_read = [self dataRead:buff :bufsize];
//done = (bytes_read < bufsize);
done = (bytes_read == 0); // <<--- <<--- <<---
if (!XML_ParseBuffer(parser, bytes_read, done))
[self errorHandler:XML_GetErrorCode(parser)];
if (done)
break;
}
}