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.

 View Only
  • 1.  Delete a specific element

    Posted Mon November 17, 2003 10:33 AM

    I would like to delete an element Person with the Lastname “AAA”. If i use Rootelement.remove(Person), all Person elements will be deleted. Could someone please help me? Thanks a lot.

    Butterfly


    TQuery query = TQuery.newInstance( “/” );
    TResponse response = accessor.query(query);
    try{
    TXMLObjectIterator ti =
    response.getXMLObjectIterator() ;
    while (ti.hasNext()) {

    try{
    TXMLObject next = ti.next() ;
    ???






    AAA
    BBB
    40


    CCC
    DDD
    50


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


  • 2.  RE: Delete a specific element

    Posted Mon November 17, 2003 03:32 PM

    Hi,

    This can be accomplished using DOM methods. One way is to obtain a node list of Lastname elements, iterate through them and if its value is AAA then remove the parent node (Person). I gather what you have attempted so far is to remove the Person element which will remove that part of the DOM tree from the document. For more information please refer to specific DOM documentation.

    Hope this helps.

    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


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


  • 3.  RE: Delete a specific element

    Posted Mon November 17, 2003 03:57 PM

    Thanks for your reply.
    I haven’t used DOM method, only JDOM method. But I will try the method you suggested.



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