Update XML without using map

Hi,
How can I update a XML document without using map.
The input to the service is a XMLNode with the xml I want to update, a String containing the exact position to update. (i.e /PackageInformation[5]/Identifier[1]) and a String with the new value to update to.

Using the queryXMLNode will give me the exact position, but can I use queryXMLNode to set a new value?

Turning the node into a document and do a “normal” mapping is not an option since all inputs differs every time the service is run.

Does anyone know if it is possible to use varible substitution (%%) somehow?
If I can avoid having to write a java service I would be happy.

Thanks in advance for any suggestions,
Age

Can anyone suggest for the above query? I also need to do the same.

I will be greatful if you can guide me.

Regards
Preeti

Hello,
I did not get the question, as you want to update the no. of fields, or the value??

Regards
Suvigya

Hi Suvigya

I need to create a service to update/set a value to xml node. The input to the service

a) XMLNode - node which is to be updated
b) XMLValue - value to be assigned to that node
Like for the below xml:


abc
5000


def
6000

For this case I will provide input as a)/employee/name/salary b)10000. The output xml should update this node to 10000 as shown:


abc
10000


def
10000

Hope you understood my query. Can you guide me how to approach this?
Regards
Preeti

Preeti,

You can try this:

Use nodeToDoc to convert to a document.Don’t map the output to anything.
Your field to be updated should be in document/xml/employee/salary
Call a java service to put the new value in this location.
Note that if employee or any other node in the path is an array, proper index should be provided.

Let me know if that works.

Thanks,
Snehashish.