The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

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 Artima Forums.

Message:

Re:XML and Java

Posted by Eoin Wren on February 08, 2001 at 9:25 AM

> Hi!
> 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!
> Thanks!


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...

Eoin





Replies:
  • Thanks! Eugene Neymark February 23, 2001 at 12:50 PM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us