on 03-10-2014 6:35 AM
Hello Experts
I am stuck with a mapping issue.
Source Payload Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:response xmlns:ns0="http://test/1.0">abc,123,def</ns0:response>
Expected Target Payload Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Record xmlns:ns0="http://test/1.0"><response><Field>abc</Field><Field>123</Field><Field>def</Field></response></ns0:Record>
Please help share any sample UDF that could be used for this.
Thanks
Jaya
Hi Jaya,
Here you go:
Input to this UDF wil be response field from source, which contains the comma separated values and output of UDF will be mapped to Field in target structure:
UDF with context option:
sourceVal - which contains the input string
String[] strArray = sourceVal[0].split(“,”);
for (String str : strArray) {
result.addValue(str);
result.addContextChange();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.