This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes insert child node in xml adding and setting value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "insert child node in xml adding and setting value" Watch "insert child node in xml adding and setting value" New topic
Author

insert child node in xml adding and setting value

Roshan Chacko Techanath
Greenhorn

Joined: Dec 13, 2004
Posts: 3
how do i generate(insert and append a node to) an xml using dom parser.
I want the xml to be physically visible and existing on the harddisk. Presently I am using the method
Node strnode=null;
strnode.setNodeValue("xyz");
It does create a node when i print it from the class. But it dosnt edit the physical file.The file remains as it is. I would like the file also to be edited so that I can use it for future data retrieval.
Can someone help meeeeeeee???

[ December 13, 2004: Message edited by: Roshan Chacko Techanath ]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
This uses Xerces to write the file, not sure if it's even possible with the built-in functionality of the JDK:



doc is an XML Document.
logger is a standard Logger


42
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This forum is for Servlet questions. I'll move this to the XML forum for you.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: insert child node in xml adding and setting value
 
Similar Threads
Adding a carriage return to a Node
Sorting XML nodes?
insert child node in xml adding and setting value
xml node insert
Comment Handling while parsing and building an xml file in xerces