Java XML Document to String toString(Document d)

Here you can find the source of toString(Document d)

Description

to String

License

Open Source License

Declaration

public static String toString(Document d) 

Method Source Code

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

import org.w3c.dom.Document;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSSerializer;

public class Main {
    public static String toString(Document d) {
        DOMImplementationLS domImplementation = (DOMImplementationLS) d.getImplementation();
        LSSerializer lsSerializer = domImplementation.createLSSerializer();
        return lsSerializer.writeToString(d);
    }//from  w ww . ja  v  a 2 s  .  c  om
}

Related

  1. getXML(Document doc)
  2. getXML(Document pDocument)
  3. toByteArray(final Document document)
  4. toByteArray(final Document document)
  5. toStream(Document document, OutputStream stream)
  6. toString(Document doc)
  7. toString(Document doc)
  8. toString(Document doc)
  9. toString(Document doc)