Code example for Document

Methods: getImplementationgetXmlEncoding

                // The Document node is the Node argument's ownerDocument 
                doc = nodeArg.getOwnerDocument();
            // Determine the XML Version.  
            if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) {
                return doc.getXmlEncoding();
        // The default encoding is UTF-8 except for the writeToString method 
        return "UTF-8"; 
     * Determines the Input Encoding of the Document Node to serialize.  If the Document Node 
     * is not a DOM Level 3 Node, then null is returned. 
     * @param  nodeArg The Node to serialize 
     * @return A String containing the input encoding.   
Experience pair programming with AI  Get Codota for Java