Our requirement is to convert XML to fixed length (Cobol Copy Book). I am using dataweave for transformation.
As per the copy book schema, maximum occurrence of “EmpNumArray” is 2. The transformation working fine if the corresponding repeated element(EmpNumArray) in the input xml occurs 2 times.
But most of the time we only get one occurrence of “EmpNumArray”, in this scenario – transformation failed with the error “”.
Question: How the Dwl code be altered to manipulate with empty spaces to match desired length?
If your requirement does not meet using Dwl you can create your custom transformer and use that to achieve the required result.