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

Question about replacing a whole XML document

  • 1.  Question about replacing a whole XML document

    Posted Thu January 12, 2006 09:03 PM

    Hi
    I retrieve a XML document from Tamino for modifying. After users submit their modification, I need to update the original XML.

    However, I couldn’t tell which fields are modified by users, so I want to replace the whole original document with the new content submitted by users.
    It seems that using TXMLObjectAccessor.update(TXMLObject) doesn’t work due to the unaccessibility of ino:id. Therefore, I should write a query to do this. Could you tell me how to replace a whole XML document by using x-query? (I don’t want to change the header of the original document)

    Or do you have any suggestion to do this in a better way?

    Thank you a lot


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


  • 2.  RE: Question about replacing a whole XML document

    Posted Fri January 13, 2006 04:44 AM

    Hello,

    It would be better if you use xquery for this purpose.
    The following is an example of an update xquery used for modifying the document:

    declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
    update for $q in input()/person
    where tf:contains-text($q/@securityNo, ‘123’)
    do replace $q with

    Let me know if this helps in solving your problem.

    All the Best.

    Regards,

    Abhijeet


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


  • 3.  RE: Question about replacing a whole XML document

    Posted Tue January 17, 2006 06:50 PM

    Hi,

    I got an error message after I follow your suggestion to replace the XML document.

    Tamino access failure (INOXQE6450, Update results in non-well-formed document)

    Do you know what causes this error?

    Thanks


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


  • 4.  RE: Question about replacing a whole XML document

    Posted Wed January 18, 2006 06:15 AM

    Hi,

    Sorry for the inconvenience.

    Accidentally a small syntax error was spelled in my last query. Please use the following,

    declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
    update for $q in input()/person
    where tf:containsText($q/@securityNo, ‘123’)
    do replace $q with

    Hope this solves your problem.


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