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

Encoding version replacment in xml file

former_member277492
Participant
7,069

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
MortenWittrock
SAP Mentor
SAP Mentor

Hi Sreekar

You can't just change the value of the encoding attribute in the XML prolog (the <?xml .... ?> part at the beginning of your document). You need to change the actual encoding of the document and then reflect that in the encoding attribute. The answer from sriprasadshivaramabhat shows you how.

Regards,

Morten