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.  getDOM4JElementTextByTagName

    Posted Thu January 09, 2003 12:51 PM

    In example file ProcessPersonsDOM4J.java, I found method “getDOM4JElementTextByTagName”.

    Here is this method:

    // Helpermethod to get the text of a given tagname from a DOM4J tree
    private static String getDOM4JElementTextByTagName(Element element, String tagname) {
    List list = element.elements();
    Element elem = (Element)list.get(0);
    return elem.node(0).getStringValue();
    }

    The problem is that it does not return appropriate tag using parameter “tagname” (in body of this method this variable is NEVER used!). I don’t really understand what is up. :frowning:

    Data returned form tamino is similar to:


    M


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


  • 2.  RE: getDOM4JElementTextByTagName

    Posted Fri January 10, 2003 11:11 AM

    Hi,

    It looks like a problem with the sample code. I changed it to:

    private static String getDOM4JElementTextByTagName(Element element, String tagname) {
    List list = element.elements(tagname);
    Element elem = (Element)list.get(0);
    return elem.node(0).getStringValue();
    }

    and that seemed to work.

    If this is not what you want, the full javadoc for DOM4J is >here<

    HTH


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


  • 3.  RE: getDOM4JElementTextByTagName

    Posted Fri January 10, 2003 11:49 AM

    Yes, now it works.

    So, I recommend to change this sample code immediately which the developers can download from:

    http://developer.softwareag.com/tamino/TaminoAPI4J/download_request.htm

    Thanks for help.

    best regards,
    Dariusz Baumann


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