Java XML Document to Writer write(Writer out, Document doc)

Here you can find the source of write(Writer out, Document doc)

Description

write

License

Open Source License

Declaration

private static void write(Writer out, Document doc) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.Writer;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.Document;

public class Main {
    private static void write(Writer out, Document doc) throws IOException {

        try {// ww w.ja  va 2 s  .  c o m
            new DefaultEditorKit().write(out, doc, 0, doc.getLength());
        } catch (BadLocationException e) {
            throw new IOException(e.getMessage());
        }
    }
}

Related

  1. toWriter(Document doc, Writer writer)
  2. toXML(Document doc, Writer w, boolean indent)
  3. writeDocument(Document doc, Writer out)
  4. writeDocument(Document doc, Writer w)
  5. writeDocument(Document document, Writer writer, Integer indent)
  6. writeDocument(PrintWriter w, Document d)