This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

xml from DOM  RSS feed

 
Bala Krishna
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!