亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

關于轉義, 不會用。。。

static java.lang.String ? ?escapeAttribute(EscapeStrategy?strategy, java.lang.String?value)

This will take the three pre-defined entities in XML 1.0 ('<', '>', and '&' - used specifically in XML elements) as well as CR/NL, tabs, and Quote characters which require escaping inside Attribute values and converts their character representation to the appropriate entity reference suitable for XML attribute content.

? ?

static java.lang.String ? ?escapeText(EscapeStrategy?strategy, java.lang.String?eol, java.lang.String?value)

This will take the three pre-defined entities in XML 1.0 ('<', '>', and '&' - used specifically in XML elements) and convert their character representation to the appropriate entity reference, suitable for XML element content.

? ?

Format ? ?setEscapeStrategy(EscapeStrategy?strategy)

Sets the?EscapeStrategy?to use for character escaping.

? ?http://www.jdom.org/docs/apidocs/org/jdom2/output/Format.html


正在回答

3 回答

以上真的是在胡說八道!不知道為什么弄不出來,還來混淆視聽!

0 回復 有任何疑惑可以回復我~
#1

soft_xiao

哈哈,你做出來沒
2017-03-10 回復 有任何疑惑可以回復我~

Element title = new Element("title");
???CDATA cdata = new CDATA("上海移動互聯網產業促進中心正式揭牌 ");
???title.setText(cdata.toString());
???channel.addContent(title);

0 回復 有任何疑惑可以回復我~

好吧,隔壁有了


Element title = new Element("title");

CDATA cdata = new CDATA("上海移動互聯網產業促進中心正式揭牌");

title.setContent(cdata);

?JessicaJiang


0 回復 有任何疑惑可以回復我~
#1

袁又袁

沒辦法用實現策略接口的方式對字符不進行轉義來實現么?
2015-07-07 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
Java眼中的XML 文件寫入
  • 參與學習       55793    人
  • 解答問題       138    個

舉例說明JAVA程序如何生成XML文檔,多種生成方式任你選擇

進入課程

關于轉義, 不會用。。。

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號