public static void saveDocumentToFile(Document doc, String filePath) throws Exception {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, “yes”);
transformer.setOutputProperty(OutputKeys.INDENT, “yes”);
transformer.setOutputProperty(OutputKeys.METHOD, “xml”);
transformer.transform(new DOMSource(doc), new StreamResult(new File(filePath)));
}
у меня вот такая функция чтоб сохранить подпись в xml, не испортить ли Transformer валидность подписи?