File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Converting the tree to a file . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Converting the tree to a file ." Watch "Converting the tree to a file ." New topic
Author

Converting the tree to a file .

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hey all.
I have developed my application to create a DOM tree in the memory (this tree is not a result of paresing an XML document, I created this tree by adding elements and attributes to the tree).
how can I convert this tree to a file like : results.xml on my hard drive ?
thanks.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You can use identity transform to serialize your DOM document into raw XML. Also, if you're using Xerces and don't mind importing org.apache.* stuff in your code, it also has a class named XMLSerializer which can produce a whole lot better-looking XML than the javax.transform.* API (and faster).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting the tree to a file .