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/Identifier) 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,
Can anyone suggest for the above query? I also need to do the same.
I will be greatful if you can guide me.
I did not get the question, as you want to update the no. of fields, or the value??
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:
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:
Hope you understood my query. Can you guide me how to approach this?
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.