Skip to main content

I have an XML file (see example attachment) from which I want to delete all Notification elements when the Notification type is 'Change of Circumstances'. So in this case I'd start with 3 Notification elements (New Claim, Change of Circumstances and Claim Termination) and once I've deleted the 'Change of Circumstances' Notification I'd just be left with 2 Notification elements (New Claim and Claim Termination).

I'd found this article (https://knowledge.safe.com/questions/77687/deleting-elements-in-xml-file.html) which seems to be what I'm after but I'm struggling to replicate it with my file.

I've been using Text File Reader with parameter 'Read Whole File at Once' set to 'Yes' and the XMLUpdater with Delete XML Path (though I'm struggling what syntax I need in the XML Path).

For info. I'm using Workbench 2018.1.2

Thanks in advance.

This XPath expression might be what you want.

//Notificationi@type="Change of Circumstances"]

See here to learn more about XPath: XPath Tutorial


Reply