File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml from DOM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml from DOM" Watch "xml from DOM" New topic

xml from DOM

Bala Krishna
Ranch Hand

Joined: Jan 26, 2001
Posts: 95
I read my xml document from a file, make some changes to it (like adding an attribute here, adding an element there etc.) using DOM. When I'm done with the changes, I want to get the changed xml from DOM. I looked at org.w3c.dom.* packages, but couldn't find a way to do it. Had to take google's help, and I've seen many people asking the same question (how do I get xml from DOM) in various forums. Finally, I stumbled upon the following code :

I tried it and it works. But, some how, I feel that it shouldn't be this complicated (albeit only a few lines of code), to get xml from DOM. Has any one else found a different/better solution to this problem?
I agree. Here's the link:
subject: xml from DOM
It's not a secret anymore!