cancel
Showing results for 
Search instead for 
Did you mean: 

XML Encoding Error

Former Member
0 Kudos

Hi,

I am getting an XML file which was encoded with UTF-8.

In my file sender channel, i do specify the filetype as text and encoding as UTF-8.

But then PI message did not pick up the & symbol and was not able to recognize it.

If the xml file was encoded with UTF-8, I would assume PI should pick it up.

The only proof that i got is that the file is encoded with utf-8 is by looking at the tag

I am also surprised that PI did not throw any error, it is just when we looked into the adapter engine payload, the xml was not recognized at this place.

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

- <Order>

- <Customer>
TThis is where it did not recognize

<DiscountOfferId> &pound;500</DiscountOfferId> I

I

Accepted Solutions (0)

Answers (3)

Answers (3)

iaki_vila
Active Contributor
0 Kudos

Hi AnandhaKrishnan,

If you want to deal with special characters you have two ways with CDATA section like Baskar mentioned above or escaping the char with its corresponding escaping character, & must be substituted with &amp;

Another character that you could have problem are

  1. < must be substituted with &lt;
  2. > must be substitutedwith &gt;
  3. " must be substituted with &quot;
  4. ' must be substituted with &#39;

Regards.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

& is a special character reserved in xml. It is reserved to indicate the beginining of character/entity references like &apos; So & must be represented as its entity reference &amp;  That means  & should be replaced with &amp;

refer this standard link

http://www.w3schools.com/xml/xml_cdata.asp

rajasekhar_reddy14
Active Contributor
0 Kudos

Open your source XML in xml editior and validate it. it looks your XML document not valid.