Re: Replacing elements in a given XML file

Jason Hunter <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
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/[email protected]


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.