Position in X-Query with Tamino API for Java

Hi
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)
{
ti.next();
count++;
}
if (count==300)
{
//my process

}

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

Thanks a lot
Tony

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

Ok
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:

input()/ABC

to return ABC documents from position 300:


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