Cursoring with XQuery

Hello, I need to do a cursoring with XQuery but a don’t know how I can to control the TResponse.

This is my code,

private TXMLObjectIterator ti = null;
int Pagesize = 12;
taminoXQuery = TXQuery.newInstance (Query);
TResponse tresp = tacc.xquery(taminoXQuery,Pagesize) ;
if ( tresp.hasFirstXMLObject() )
ti = tresp.getXMLObjectIterator() ;

// ???
// How can to move in the diferent pages and how can to control the start of the results

Thanks a lot!

Hello there.

It is not necessary to “manually” move between pages. The API will handle the cursoring aspects (requesting the next page and such) “under the covers”.

All you need to do in your code is use the next() method of the TXMLObjectIterator to get the query results as TXMLObject instances. When the current page is exhausted the API will automatically request the next page of results from Tamino.

I hope that helps,