aspose file tools*
The moose likes XML and Related Technologies and the fly likes Change the value of a child element. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Change the value of a child element." Watch "Change the value of a child element." New topic
Author

Change the value of a child element.

vidhi sanghavi
Greenhorn

Joined: Mar 28, 2009
Posts: 13
Hi,


I have an XML structure as follows:


<employees>

<employee data="Name">
<value>Vidhi</value>
</employee>

<employee data="qualification">
<value>BE</value>
</employee>

</employees>
Whwn I parse the XML document I want to change the value of element <employee data="Name">
to Sami
ie I wan the XML structure to be
<employees>

<employee data="Name">
<value>Sami</value>
</employee>

<employee data="qualification">
<value>BE</value>
</employee>

</employees>
I am using JAVA and org.dom4j.SAXReader


Thanks in advance
Vidhi
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
What have you accomplished so far?

Can you locate the <employee> element and get the data attribute value?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change the value of a child element.