dss/src/test/java/gov/samhsa/c2s/dss/service/FileHelper.java
public static void writeDocToFile(Document doc, String fileName)
            throws Exception {
        File encryptionFile = new File("c:\\temp\\" + fileName);
        FileOutputStream f = new FileOutputStream(encryptionFile);

        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();
        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        DOMSource source = new DOMSource(doc);
        StreamResult result = new StreamResult(f);
        transformer.transform(source, result);

        f.close();
    }
/**
     * *****************************************
     * Output Document to file
     * ******************************************.
     *
     * @param doc the doc
     * @param fileName the file name
     * @throws Exception the exception
     */
Output Document to file
.

@param doc the doc
@param fileName the file name
@throws Exception the exception
Output Document to file . @param doc the doc @param fileName the file name @throws Exception the exception
public static void writeDocToFile(Document doc, String fileName)
            throws Exception {
        File encryptionFile = new File("c:\\temp\\" + fileName);
        FileOutputStream f = new FileOutputStream(encryptionFile);
        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();
        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        DOMSource source = new DOMSource(doc);
        StreamResult result = new StreamResult(f);
        transformer.transform(source, result);
        f.close();
    }
public static void writeDocToFile ( Document doc , String fileName ) throws Exception { File encryptionFile = new File ( "c:\\temp\\" + fileName ) ; FileOutputStream f = new FileOutputStream ( encryptionFile ) ; TransformerFactory factory = TransformerFactory . newInstance ( ) ; Transformer transformer = factory . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "yes" ) ; DOMSource source = new DOMSource ( doc ) ; StreamResult result = new StreamResult ( f ) ; transformer . transform ( source , result ) ; f . close ( ) ; }
Output Document to file
 ******************************************.
Output Document to file ****************************************** .