Document 按照xml格式输出

时间:2014-06-22 12:27:02   收藏:0   阅读:192
    private void GetXMLDocument(Document doc)
    {
         OutputFormat format1 = new OutputFormat("    ", true);
         format1.setEncoding("UTF-8");
          XMLWriter out1=new XMLWriter(new PrintWriter(System.out),format1);
          try {
            out1.write(doc);
            out1.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

 

Document 按照xml格式输出,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!