cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Encoding version replacment in xml file

former_member277492
Participant
7,059

Hello Experts,

I have got a requirement where Incoming xml with encoding version 'UTF-8' as below and output file is expected with 'ISO-8859-1' tag.

Input:<?xml version="1.0" encoding="UTF-8"?>

Output: <?xml version="1.0" encoding="ISO-8859-1"?> (Required)

Sample file structure below;

<?xml version="1.0" encoding="UTF-8"?>

<EMPLEADOS>

<EMPLEADO NUMERO="100000676" TIPO="A">

<PROCESO PAC="000000" PERIODO="12345" TT="MN"/>

<SECCION ID="ABCD">

<CAMPO1 FECHA="" ID="PTP_POCATP" SEC="">0.97</CAMPO1>

<CAMPO2 FECHA="" ID="PTP_SPPOC105" SEC="">39.0</CAMPO2>

</SECCION7>

</EMPLEADO>

</EMPLEADOS>.

Do we have any groovy to fulfil this requirement. Please suggest.

Thanks in advance,

Best Regards,

Sree

View Entire Topic
Sriprasadsbhat
Active Contributor

Hello Sreekar,

Before you send the data to Target system add content modifier and set the property with below parameters which changes the Encoding.

Action       Name                    Type                  Value
Create       CamelCharsetName        Constant              ISO-8859-1
        

Regards,

Sriprasad Shivaram Bhat