[xml] Regarding xmlTextReaderNext Api



 

Hi,

 

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)

                return(ret);

} 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 !!

 

Regards

Ashwin



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