Skip to Content

How to convert special charecter "&" in XML(not well formed) through XSLT

Hi Experts,

Can any one tell me how to process the symbol '&' which is coming from incoming payload and throwing error in PI message mapping. I knew that the symbols &,<,> are not allowed in XML, and these symbols need to specified as like &

can anybody help to achieve this through XSLT mapping.

test messgae:

<Emp_Info>
<Ename>Govardhan</Ename>
<salary>100000</salary>
<locaton>delhi</locaton>
<designation>SSE</designation>
<address>Delhi&Banglore</address>
</Emp_Info>

In the above example, I need to replace the & symbol to &

Result:

<Emp_Info>
<Ename>Govardhan</Ename>
<salary>100000</salary>
<locaton>delhi</locaton>
<designation>SSE</designation>
<address>Delhi&Banglore</address>
</Emp_Info>

Thanks,

Govardhan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 08 at 02:50 PM

    Hi Govardhan!

    You could use java mapping to get payload as text string and replace "&" symbol with respective escape sequence.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • May 08 at 02:53 PM

    agree w the prev comment -- all special chars have to be (XML) escaped, for example: & for &

    Add comment
    10|10000 characters needed characters exceeded