![]() |
problem: writing out an XML file always includes the commented DTD in the beginning. Why?
My problem is, I use javax.xml.Transform to write out a modified
Document object to a file. It has a dtd, and it is included every time in the written file, no matter what. Why? How do I get rid of the behaviour? Here's the code: try { // Create a transformer Transformer xformer = TransformerFactory.newInstance() .newTransformer(); // Write the DOM document to a file Source source = new DOMSource(doc); File newFile = new File(foo.xml); Result result = new StreamResult(newFile); xformer.transform(source, result); } catch (TransformerConfigurationException e) { System.out.println(e.getMessage()); } catch (TransformerException e) { System.out.println(e.getMessage()); } |
| All times are GMT. The time now is 10:37 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.