Position in X-Query with Tamino API for Java

I use Tamino 4.4 with “Tamino API for Java” but I come from Tamino 2.2.
In a query, I have a result of 4000 XML but only need the document from positon >= 300
My first idea is

TQuery query = TQuery.newInstance(“ESQ0011[Factura/FechaEmision=‘20061108’]”);
TResponse tresp = tacc.query(query, PAGE_SIZE);
int count=0;

while (ti.hasNext() && count<300)
if (count==300)
//my process


I suppose that better ways to do it. I would like some recomendation, help, … whatever.

Thanks a lot

You may be better off trying XQuery and using the position() function.

Some quickstart tutorial about XQuery, for someone who know X-Query?

I’d recommend looking at the XQuery tutorial in the Tamino documentation.
XQuery is significantly different to X-Query.
A lot of XQuery is FLWOR expressions (for/let/where/order/return).

simple example to return all ABC documents:


to return ABC documents from position 300:

(for $p in input()/ABC return $p)[position() >= 300]