This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Re:XML and Java
Posted by Eoin Wren on February 08, 2001 at 9:25 AM
> I'm trying to edit an xml file using java's dom parser.
> Well.. the setNodeValue(String) does set it but it doesn't seem to affect the actual xml file. replacing a child doesn't cut it either ;( I would hate to manualy recreate the file using stringbuffer or something..
> How do I save my changes to XML file?
> Is there a way ? I heard about java-xml editors, but I would rather do it myself since it's not a large scale thing.
> Any advice is greatly appriciated!
The last XML project I worked on we had a similar problem. To overcome it, we simply renamed the XML file on disk, and recreated the original from the DOM, using the XmlDocument.write method.
Hope that helps...
- Thanks! Eugene Neymark February 23, 2001 at 12:50 PM