易截截图软件、单文件、免安装、纯绿色、仅160KB

XML中回车的问题 - Web 开发 / XML/SOAP

大家请看,这个是我写的生成xml的方法,用的是jdom,请问如何可以使生成的xml中的段落里带“回车”???
public void bulidprotocolxml(String textarea)throws IOException, JDOMException {
Element root, e1;
Document Doc; 
root = new Element("protocol_");
Doc = new Document(root);

//第一个protocol结点及子结点
e1 = new Element("protocol");
e1.setAttribute("id","01");

Element e11 = new Element("content");
e11.setText(textarea);
e1.addContent(e11); 
root.addContent(e1);

XMLOutputter XMLOut = new XMLOutputter();
Format format = Format.getCompactFormat();
format.setIndent(" "); //在元素后换行,每一层元素缩排两格
format.setEncoding("gb2312"); //设置字符编码
XMLOut.setFormat(format); //设定格式
XMLOut.output(Doc, new FileOutputStream(/test.xml));
}

貌似不行啊朋友
{{


相关问答:

关于XML解析天气预报 - 移动平台 / Android

用SAX解析XML中,使用这段代码
String feed="http://www.google.com/ig/api?weather="+strCity; 
  URL url = new URL(feed.replace(" ", "%20"));  
......

XML 的读写 - Web 开发 / XML/SOAP

<?xml version="1.0" encoding="utf-8" ?>
<HuiSin>
  <admin>100,100</admin>
  <user>200,200</user>
怎样在这里添加一个新的呢?
< ......

XML DOM 去元素值的问题 - Web 开发 / XML/SOAP

loadxmldoc.js文件内容:
function loadXMLDoc(dname) 
{
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
&nb ......

c#操作xml的问题 急! 高手指教 - .NET技术 / C#

先上代码
 public override string SerializeToXml(object objArg)
  {
  if (objArg == null)
  return "";
  StringBuild ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号