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
  • 1.  Updating xml

    Posted Tue November 12, 2002 08:19 AM

    Hi,

    If I have a schema that has an unbounded element in it, for example a party may have many addresses, and I want to know how many of these are populated when I access the data, how do I know how many occurrences are populated? I assume that I would have to loop through the data to find out how many are populated, how do I do this with Javascript?

    This raises the question of how do I then update the 5th occurrence in this unbounded element and save it back to the repository?



    We currently using html/Javascript.

    Thanks

    Miklos Hagymassy


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


  • 2.  RE: Updating xml

    Posted Tue November 12, 2002 09:48 AM

    Using the MSXML DOM you don’t need to count the number of elements because the IXMLDOMNodeList interface has a length property, e.g

    var Party = …
    var Address = Party.childNodes ;
    var numAddress = Address.length ;

    For updating the whole document if using IIS, MSXML DOM there are two options:
    - get the whole document instance, make the modifications to the DOM tree and process the whole document back to Tamino. Tamino will do an update (and not an insert) if the root element contains the ino:id attribute.
    - use NodeLevelUpdate feature. There’s an excellent FAQ on this feature that can be found here.


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


  • 3.  RE: Updating xml

    Posted Tue November 12, 2002 10:21 AM

    …just to illustrate what Stuart has suggested, here’s a small javascript example that you should be able to modify to suit your needs.

    HTH
    example.js (2 KB)


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


  • 4.  RE: Updating xml

    Posted Mon November 25, 2002 02:10 PM