/**
* Writes a document to a file. A new file is created if it does
not exist.
* @param document The document to save.
* @param file The file to save the document to.
* @throws IOException if an error occurs
* @throws TransformerConfigurationException if an error occurs
* @throws TransformerException if an error occurs
*/
public static void writeDocument(Document document, File file)
throws TransformerConfigurationException,
TransformerException, IOException {
// sanity checks
if (document == null)
throw new IllegalArgumentException("illegal usage,
parameter document may not be null");
if (file == null)
throw new IllegalArgumentException("illegal usage,
parameter file may not be null");
file.getParentFile().mkdirs();
file.createNewFile();
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(file);
getTransformer(document.getDoctype()).transform(source, result);
}
this code is wrong. the method takes a DOM document, while the code
thinks it's dealing with a lenya document. document.getDoctye() does not
make sense here. this keeps the forms editor from working in 1.4
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]