Skip to content

Instantly share code, notes, and snippets.

@jam01
Created May 25, 2017 14:43
Show Gist options
  • Save jam01/ad2c3770da96569d86ce78d34c597387 to your computer and use it in GitHub Desktop.
Save jam01/ad2c3770da96569d86ce78d34c597387 to your computer and use it in GitHub Desktop.
This script will filter out all null and empty fields except the ones you specify. Useful where for some reason some xml fields have null values but relevant info in the attributes.
%dw 1.0
%output application/xml
---
{
result: payload filter ($ != null and $ != '' or $$ == 'someSpecificField')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment