Re: [xml] Getting the offset of a node in the stream

Michael Ludwig wrote:
Alberto Mardegan schrieb:

  I'm using an xmlTextReader (and the xmlTextReaderNext() function) to
read an XML file, and once I find a specific element I must be able to
tell at what byte offset in the file this element is found.
Second, do you really have to take such a low-low-low-level approach?
That might well be that case; but if not, there might be easier ways to
solve the problem.

It's soon explained: I'm writing a C library that needs to parse some XML files (only part of them, till it finds a certain element), and a Qt wrapper for the same library. The wrapper library doesn't need to parse the initial part of the document, but only from the same element where the C library stopped parsing.

If there was a way to create a QXmlStreamReader wrapping the xmlTextReader, than that would be the best, because then the state could be retained; but it seems to me that there isn't.

In short, I'd like to avoid to parse the initial part of the XML file twice.

Any hints?


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