Skip to Content
0

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

May 08 at 02:41 PM

29

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Evgeniy Kolmakov May 08 at 02:50 PM
0

Hi Govardhan!

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

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
Sergio Guerrero May 08 at 02:53 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded