Return-Path: Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 39716 invoked by uid 500); 8 May 2003 13:05:27 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 39690 invoked from network); 8 May 2003 13:05:27 -0000 X-Originating-IP: [62.255.64.5] X-Originating-Email: [matthewoatham@hotmail.com] From: "Matthew Oatham" To: general@xml.apache.org Bcc: Subject: XML DOM to file using Transformer Date: Thu, 08 May 2003 14:05:28 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 08 May 2003 13:05:28.0856 (UTC) FILETIME=[7F9E3980:01C31562] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I have managed to load an xml file to a DOM and manipulate the tree, however when I write the DOM to file using TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); File testFile = new File("C:\\testFile.xml"); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(testFile); transformer.transform(source, result); The resulting file has no line breaks and the elements are all on on line! Is there any way I can preserve the formatting of the original xml file I used to create the DOM? Thanks Matt _________________________________________________________________ Hotmail messages direct to your mobile phone http://www.msn.co.uk/mobile --------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org