Re[jdom-interest] placing elements in a given XML file

Jason Hunter jhunter at servlets.com
Wed Feb 24 11:08:36 PST 2010


Load the doc from the file, make the change, then save the file back.  To make the change you'll need to use JDOM's calls to navigate the tree and setText() on the right Element.

-jh-

On Feb 16, 2010, at 2:10 AM, nepnep wrote:

> 
> I am looking for a way to change element's text in a XML file.
> I want the changes to be saved in that file!!
> 
> The XML file:
> 
> <root>
>   <attack>
>       <test>
>          <analysis>
>              <name>Element's Name</name>
>              <value>20000</value>
>          </analysis>
>       </test>
>   </attack>
> </root>
> 
> I want to change only the value , let's say, to 10000.
> 
> I'd be very happy if someone can help me with that one,
> Thanks.
> -- 
> View this message in context: http://old.nabble.com/Replacing-elements-in-a-given-XML-file-tp27606018p27606018.html
> Sent from the JDOM - General mailing list archive at Nabble.com.
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com




More information about the jdom-interest mailing list