Example usage for javax.xml.transform.dom DOMSource DOMSource

List of usage examples for javax.xml.transform.dom DOMSource DOMSource

Introduction

In this page you can find the example usage for javax.xml.transform.dom DOMSource DOMSource.

Prototype

public DOMSource(Node node, String systemID) 

Source Link

Document

Create a new input source with a DOM node, and with the system ID also passed in as the base URI.

Usage

From source file:Main.java

private static Transformer newTransformer(Document source) {
    Source tSource = new DOMSource(source, "");
    try {/*from  w w  w  . jav a  2s  .c o  m*/
        Templates tmpls = tFactory.newTemplates(tSource);
        Transformer ret = tmpls.newTransformer();
        return ret;
    } catch (TransformerConfigurationException e) {
        return null;
    }
}