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
Expand all | Collapse all

using the xpath statement 'between' in xapplication

  • 1.  using the xpath statement 'between' in xapplication

    Posted Thu March 07, 2002 11:29 AM

    X-Application Version: 3.1.2, 3.1.1
    Tamino Version : 3.1.1
    Platform : NT, Win2k, Solaris, …
    WebContainer : Tomcat 3.3
    JDK Version : 1.3.1

    Hello,
    I want to use the XPath statement ‘between’ in a query. It seems that XApplication only supports simple queries such as /node[childnode = date]. Is there a way to implement a more complex query such as /node[childnode between date_low, date_high]? Thanks in advance.
    Cheers,
    Karsten


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: using the xpath statement 'between' in xapplication

    Posted Thu March 07, 2002 12:46 PM

    Hello,

    to check a range the Query Object Model of X-Application provides a QueryRange. It is a query item which uses <=,< and >=,> operators for filter expression. In your case the use of QueryRange would

    /node[childnode >= date_low and childnode <= date_high]

    To use the ?between? operator you could use a QueryFilter.

    If the Query Object Model does not fit your requirements there is a way to create a cursor for documents directly. Use the following code:


    // define how many document should be returned by on request.
    int pagesize = 10;

    // load the schema for your query.
    Schema nodeSchema = Schema.read(workspace.getStore(), “node”, false);

    // name which is used by the cursor to register the current document within the workspace
    String name = ?myNodes?;

    // create the cursor for query set
    BusinessDocumentCursor bdc = new BusinessDocumentCursor (“/node[childnode between date_low, date_high]”, workspace, name, nodeSchema, pagesize);

    I hope that this will help you to define your queries.

    Bye,
    Christian.


    #webMethods
    #API-Management
    #Tamino