Update XML File with XPath

Update XML files using XPath to locate items to edit.
Table 1. Input properties for the Update XML File with XPath step
Name Type Description Required
Directory Offset String A sub-directory of the current working directory where the step should execute. No
File Includes String A new line separated list of include patterns for files to modify. Yes
File Excludes String A new line separated list of exclude patterns for files to skip. No
Replace with text String Specify a new line separated list of XPath expression-replacement pairs. For example, /root/a/@myattribute->myvalue will look for the all a elements under the root element and replace their myattribute attribute value with myvalue. This will not do anything if the attribute myatrribute does not exist. No
Remove String A new line separated list of XPath expressions for elements to remove. For example, /root/a will remove all elements a under the root element. No
Insert XML String Specify a new line separated list of XPath expression-content pairs. For example, /root/a-<b/> will look for the all a elements under the root element and insert an empty child element b. No
Set Attributes String Specify a new line separated list of XPath expression-replacement pairs. For example, /root/a/@b->c will look for all a elements under the root element and replace their b attribute value with c. The XPath expression must end with the /@name of the attribute you want to insert/update and contain a -> separator to denote the value. No
Fail if no match found Boolean Select here if you want the step to fail if any of the XPath expressions do not return a match. No

Feedback