Code example for DOMResult

Methods: getNode

0
     
        /** 
         * Return the newly built Document. 
         */ 
        public Document getDocument() {
            if (this.result == null || this.result.getNode() == null) {
                return null; 
            } else if (this.result.getNode().getNodeType() == Node.DOCUMENT_NODE) {
                return (Document) this.result.getNode();
            } else { 
                return this.result.getNode().getOwnerDocument();
            } 
        } 
     
        public void setDocumentLocator(Locator locator) {
            nextHandler.setDocumentLocator(locator);
        } 
         
        public void startDocument() throws SAXException { 
            nextHandler.startDocument(); 
        }