Re: [xml] Regarding xmlTextReaderNext Api

Hi Ashwin, all,

I think this forgotten post of mine

is related.

-- Petr

On st 25. Äervna 2008, Ashwin wrote:

I am parsing using the reader walker Api's. While walking the
tree I need to skip the subtree for a certain element, I tried to
use the xmlTextReaderNext API, however it is returning me an
erroneous result, it returns me the child node of the element
whose subtree I want to skip.

This happens because in case of a preparsed document a different
set of Api's are called

if (reader->doc != NULL)

        return(xmlTextReaderNextTree(reader)); ------> This API
too should effectively skip the sub-tree, but it does not.

If however I create a reader using xmlReaderForMemory then the
functionality is fine, as it goes to the following part of the
code in xmlTextReaderNext

do {

        ret = xmlTextReaderRead(reader);

            if (ret != 1)


} while (reader->node != cur);

And returns the node after skipping the sub-tree.

Is this a usage issue or a problem with the implementation of
xmlTextReaderNextTree Api, which is invoked in the case of
pre-parsed documents.

Any pointers would be invaluable and greatly appreciated.

Thanks !!



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