[jdom-interest] append to xml

florianwendland at freenet.de florianwendland at freenet.de
Thu May 3 14:06:54 PDT 2007


IMHO, the build-Method is not meant to restore the modified 
xml-document. You have to output the new document and store at manually 
with a FileWriter for example.

Pleas le me know, whether I am wrong about this or not.

pajeczyca schrieb:
> I am trying to appent to existing xml, but something doesn't work
> what am i missing??
> My code
> 
> doc = new SAXBuilder()build("file.xml");
> 
> Element e = new Element("person");
> e.setAttribute("name", "Joe");
> 
> doc.getRootElement().addContent(e);
> 
> I get no errors but my xml file is not changed
> 
> Thank you
> 
> Agnes
> 
> 
> 


More information about the jdom-interest mailing list