Code example for DOMImplementation

Methods: getFeature

0
    publisherElement2.appendChild(publisherText2);
 
    // Serialize a DOM document to an XML as a string 
    DOMImplementation impl = document.getImplementation();
    DOMImplementationLS implLS =
      (DOMImplementationLS) impl.getFeature("LS", "3.0");
    LSSerializer serializer = implLS.createLSSerializer();
    String out = serializer.writeToString(document);
    System.out.println(out);
 
    // Write XML to a text file 
    Formatter output = new Formatter("temp.xml"); 
    output.format("%s", out);
    output.close(); 
  } 
} 
Contextual code suggestions in your IDE  Get Codota for Java