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

How to append child element to tamino document

  • 1.  How to append child element to tamino document

    Posted Thu September 09, 2004 09:22 AM

    Hi,

    I want to append child node to tamino document without downloading whole document first. IIS filter is installed.

    I have tried to do it with following javascript code, but nothing happend:

    +++++++++++++++++++++++++++++
    QueryObj = new TaminoClient(dbname, pageSize);
    QueryObj.startSession();

    //Node to be inserted
    tempNode = XMLRDBDocNode.firstChild;
    test = QueryObj.appendChild(“/RootNode/@1”,“/RootNode/ChildNode/”,tempNode);

    test1 = QueryObj.commit();
    QueryObj.endSession();

    document.write("test: “+test+” test1: "+test1);

    ++++++++++++++++++++++++++++

    and the print result was :“test: [object Object] test1: [object Object]”

    Can anyone help me please?

    Regards
    -Coolman


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


  • 2.  RE: How to append child element to tamino document

    Posted Thu September 09, 2004 11:09 AM

    On the this page Tamino Developer there is a document referenced “From NodeLevelUpdate Methods to XQuery Usage” that should provide suitable examples of NodeLevelUpdate usage.

    However please note that if you are using Tamino 4 then you would be better off using XQuery update functionality rather than NodeLevelUpdate. The performance of XQuery should be signficantly faster than NodeLevelUpdate. NodeLevelUpdate is “old hat” and was implemented long before Tamino supported XQuery.


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


  • 3.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 01:18 PM

    My appendChild doesn’t work.

    I have Tamino version 4.1.4, how I can use XQuery update functionality with javascript.

    -CoolMan


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


  • 4.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 01:43 PM

    Do you have a method “xquery” in TaminoLib.js?

    If you do then you can use XQuery update like the examples provided in the NodeLevelUpdate Migration guide.


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


  • 5.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 01:58 PM


  • 6.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 02:53 PM

    Unfortunately it looks like you don’t have the xquery function in this version.


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


  • 7.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 03:28 PM

    Why my nodelevelupdate don’t work.

    I tried Stuart Fyffe-Collins’s NodelevelUpdate_examples from site: http://tamino.forums.softwareag.com/viewtopic.php?p=6740.

    Everything else is working but, xml-document is not updated.

    I need still help…

    -CoolMan


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


  • 8.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 03:32 PM

    AppendChild function below:

    function AppendChild()
    {
    var DATABASEURL = “http://XXX/tamino/x_database” ;
    var COLLECTION = “nodelevelupdate” ;

    var tam = new TaminoClient (DATABASEURL) ;
    tam.setEncoding(“utf-8”);

    // we will update the document with ino:id = 2
    // by appending a new node d to the end of the document.
    var doc = new ActiveXObject(“MSXML2.DOMDocument”) ;
    var elem = doc.createElement (“d”) ;
    var text = doc.createTextNode (“node d value is d1”) ;
    elem.appendChild (text) ;

    var relURL = “/” + COLLECTION + “/sample/@2” ;
    var xpath = “sample” ;
    tam.appendChild (relURL, xpath, elem) ;
    }


    -CoolMan


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


  • 9.  RE: How to append child element to tamino document

    Posted Fri September 10, 2004 03:50 PM

    I must admit that seeing errors from NodeLevelUpdate is not very easy!

    However, note that most node level update operations require that the node you operate on is unique. So if in your document /RootNode/ChildNode does not define a unique node then the operation will not work.


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