• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change the value of a child element.

 
vidhi sanghavi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you accomplished so far?

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

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic