Reputation: 1
In database I have a message template which contains "it's"
in the string, so when I take that message template and make a xml format, I'm getting it's
in xml tag.
sms.setMessage(createSMS.messageFormatter(sms).getMessage());
tagList = new TagList[4];
req.setTaglist(tagList);
tagList[0] = new TagList();
tagList[0].setTagName("OA");
tagList[0].setTagValue(dto.getDaInk());
tagList[1] = new TagList();
tagList[1].setTagName("DA");
sms.setMsisdnTosent(Utilities.appendCountryCode(sms.getMsisdnTosent()));
tagList[1].setTagValue(sms.getMsisdnTosent());
tagList[2] = new TagList();
tagList[2].setTagName("MESSAGE");
tagList[2].setTagValue(sms.getMessage());
tagList[3] = new TagList();
tagList[3].setTagName(Tags.TONE_ID);
tagList[3].setTagValue(sms.getSongId());
I'm getting like this,
<tagData>
<name>MESSAGE</name>
<value>Dear customer it""s a confirmation messege sent to activate Tune ALLAHUMMA EGHFER LE ABAENA WA OMMAHATENA you just heard Latest,reply with * to copy the Tune, of artist AL SHEIKH MAHER BIN HAMAD AL MUAIQLY and toneId is 176577,cndtn aply.</value>
</tagData>
But I want, it""s
this to be replaced with it's
Upvotes: 0
Views: 951
Reputation: 6190
As suggested by yash you can use org.apache.commons.lang.StringEscapeUtils on your xml variable before you edit it:
StringEscapeUtils.unescapeXml(xml);
Upvotes: 2