IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.


#TechXchangePresenter
 View Only
  • 1.  JDOM parsing

    Posted Wed February 08, 2006 12:29 PM

    hi,

    TXQuery query = TXQuery.newInstance("for $a in input()/user_detail/user "
    + “where $a/@user_id = '” + userNameTmp + "’ "
    + “and $a/@password = '” + tmpPassWord + "’ "
    + “return $a”);
    System.out.println("Query: " + query);

            TResponse response = accessor.xquery(query);
    

    i want to parse this query result through jdom which is in the form of TResponse, plz can anybody suggest me what i have to do next.


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: JDOM parsing

    Posted Fri February 10, 2006 03:02 PM

    Assuming you have created an Accessor like this:

    
    TXMLObjectAccessor myAccessor = myConnection.newXMLObjectAccessor(TAccessLocation.newInstance( DB_COLLECTION ) ,
    TJDOMObjectModel.getInstance() );

    the API TResponse will contain JDOM instances, so you just need code like this to step through the root "org.jdom.Element"s:

    
    if (response.getReturnValue().equals("0")) {
    TXMLObjectIterator it = response.getXMLObjectIterator();
    while (it.hasNext()) { 
    TXMLObject myObject = it.next();
    System.out.println("Getting Root Element");
    Element myRootElement = (Element) myObject.getElement();
    System.out.println(myRootElement);	
    }
    }

    #webMethods
    #Tamino
    #API-Management