Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Help Regarding adding tag in Xml file Using DOM parser

  Asked By: Aditi    Date: Nov 13    Category: Java    Views: 3242
  

I have a problem regarding writing in XML file through java using DOMparser. I want 2 add new tag in XML file like

I have a file as following


<EmployeeSet>
<Employee>
<FirstName>John</FirstName>
<LastName>David</LastName>
</Employee>
</EmployeeSet>

Now I want 2 add another <Employee> Tag in this file
How can I do it.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Rafael Thompson     Answered On: Nov 13

Go through the sample program given in the following link, which
would allow you to add  a child node. Hope this one helps you.

http://www.egjug.org/parsing_xml_file_using_dom

 
Answer #2    Answered By: Helga Miller     Answered On: Nov 13

it is pretty stright forward you can just add  a new tag  in xml  file
and traverse thru java  API

Please let me know if you require simple example

by the way, "problem regarding writing  in XML file  through java "

What problem  you are facing?

 
Didn't find what you were looking for? Find more on Help Regarding adding tag in Xml file Using DOM parser Or get search suggestion and latest updates.




Tagged: