The XML Update action is one of the actions at your disposal to work with XML data.
XML Update enables you to update an XML input, if the input tag exists, or to insert the input tag, if it doesn't exist, using XPath.
The action will be able to update data from an XML input using an XPath expression.
The action is used to update the XML data that we will import into our process for future use.
Input xml string - Input your XML schema in a process variable of type string
Input xml file - Input your XML file in a process variable of type file
Xpath expression - Input XPath expression for obtaining the key value(s) for your XML input
Xml tag - Input XML tag you want to update or insert
New value - Input new value to update the XML node
File name - input file name if you want to store the new XML in a file. The .xml extensions will be automatically added.
String result - returns the new XML as a string
File result - returns the new XML as a file
How to configure the XML Update action?
1. Create a process and give it a name.
2. Drag the XML update action to the canvas and link it to the other actions.
3. Create the variables needed for the configuration of the action, and then add them to the configuration panel:
In New Value we added "Great Gatsby" which will be updating the title of book,. i.e. "Harry Potter".
4. Save, Validate and Run the process.
5. The process will ask for inputs: (see values with example purposes below)
6. Click Run.
7. Click Check Instance to view the results. You will see the new XML string saved in the result variable. The title of book is updated to "Great Gatbsy".