[xml] xmlTextReader and parseChunk


I would like to know if it is possible to use xmlTextReader, but with
a parseChunk interface?

Actually I do:

// I removed the checks to simplify the code
buffer = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
reader = xmlNewTextReader(buffer, url);

void data_received(const char *data, size_t len)
        xmlParserInputBufferPush(buffer, len, data);
        while (xmlTextReaderRead(reader) == 1)

This works but I noticed that the last chunk may not be parsed.
How can I make the reader to consume all the remaining data?

Alexandre Bique

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]