风中过客
2015-06-11 23:11
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
以上真的是在胡说八道!不知道为什么弄不出来,还来混淆视听!
Element title = new Element("title");
CDATA cdata = new CDATA("上海移动互联网产业促进中心正式揭牌 ");
title.setText(cdata.toString());
channel.addContent(title);
好吧,隔壁有了
Element title = new Element("title");
CDATA cdata = new CDATA("上海移动互联网产业促进中心正式揭牌");
title.setContent(cdata);
JessicaJiang
Java眼中的XML 文件写入
55798 学习 · 132 问题
相似问题