webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Position in X-Query with Tamino API for Java

    Posted Wed November 08, 2006 11:22 AM

    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


    #webMethods
    #API-Management
    #webMethods-Tamino-XML-Server-APIs


  • 2.  RE: Position in X-Query with Tamino API for Java

    Posted Wed November 08, 2006 12:59 PM

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


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 3.  RE: Position in X-Query with Tamino API for Java

    Posted Wed November 08, 2006 01:19 PM

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


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 4.  RE: Position in X-Query with Tamino API for Java

    Posted Wed November 08, 2006 01:33 PM

    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]

    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods