Skip to Content
0
Former Member
Dec 10, 2013 at 01:29 PM

Java code to parse the content of input XML and send to target field

18 Views

HI All,

I have the following UDF code which will parse the input XML and send some portion to the target element

String temp = a[0].substring(a[0].indexOf(b[0])+(b[0].length()));

String value = temp.substring(0,temp.indexOf("/")-2);

result.addValue(value);

Actual input should come is value="149433" /. Now the present input doesn't contain space after quotation symbol (value="149433"/)which is truncating the last digit(The output going is 14943 instead of 149433)

The above UDF will remove the last 2 characters and send the output to target field. The new requirement is the entire value should send to target field. Please advise how to achieve the requirement(with space&quotation, without space and with quotation)