Question about replacing a whole XML document

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

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

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

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.