1. 程式人生 > >用dom4j解析xml檔案寫入記事本時,解決換行問題

用dom4j解析xml檔案寫入記事本時,解決換行問題

  }
  try
  {
  
    OutputFormat   format  = new OutputFormat("  ",true);
    format.setLineSeparator("/n/r");
       XMLWriter xmlWriter = new XMLWriter(new FileOutputStream("C://students.xml"),format);
       xmlWriter.write(dc);
  }
  catch(Exception e)
  {
   System.out.println(e);
   
   
  }