【发布时间】:2019-03-25 08:35:57
【问题描述】:
在数据库中,我有一个在字符串中包含 "it's" 的消息模板,所以当我采用该消息模板并制作 xml 格式时,我在 xml 标记中得到 it's。
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());
我是这样的,
<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>
但我想,it&quot;&quot;s 替换为 it's
【问题讨论】:
-
您能否展示一下您用于从 taglist 数组中编辑 xml 的代码?
-
你读过
org.apache.commons.lang.StringEscapeUtils吗? -
一个单引号
'怎么变成了两个双引号""???