On Thursday, July 31, 2003, at 08:53 am,
夏洛克 wrote:
thank you sir. But I still confuse with... hasn't any method to update/modify the content of the element without add/remove in the dom4j api??? thk you sir ^_^
What do you mean by 'modify the content'? Just changing the textual content? If so use Element.setText(String).
----- Original Message ----- From: [EMAIL PROTECTED] To: 夏洛克 Cc: [EMAIL PROTECTED] Sent: Thursday, July 31, 2003 3:06 PM Subject: Re: about modify xml element content... On Thursday, July 31, 2003, at 04:03 am, 夏洛克 wrote: Hi,dear sir: If I has a xml file like below, how can I modify the content of <outserverip> with java?? thank you very much ^_^ http://dom4j.org/guide.html navigate to where you want and then add/remote items from the List of nodes (the content() method) --------------BEFORE <?xml version="1.0" encoding="BIG5"?> <myICQSystemConfig> <myICQserversetting> <serverlocation>公司</serverlocation> <outserverip>192.168.0.1</outserverip> <inserverip>10.144.89.208</inserverip> </myICQserversetting> </myICQSystemConfig> --------------AFTER <?xml version="1.0" encoding="BIG5"?> <myICQSystemConfig> <myICQserversetting> <serverlocation>公司</serverlocation> <outserverip>10.144.88.77</outserverip> <inserverip>10.28.55.77</inserverip> </myICQserversetting> </myICQSystemConfig> <image.tiff> Sherlock 蔡政倫 ChungHwa Telecom Co., Ltd. TOPS 891-1 TEL:(02)3707-8672 FAX:(02)23445032 E-mail: [EMAIL PROTECTED] James ------- http://radio.weblogs.com/0112098/
James ------- http://radio.weblogs.com/0112098/