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



Alberto Mardegan schrieb:
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.

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.

I see. However, it looks to me like you're already using the best means
available. Others might know if there is a way to maintain the state
other than keeping the xmlTextReaderPtr around (which probably isn't
an option for you) - but I don't.

Ciao

--
Michael Ludwig



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