• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating multiple Elements-Iterations in xml

 
Mohan Vinukonda
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to create a xml having iterations. for example Employee would have name,designation,sal. I need to create a an xml for multiple employees. can you please give me suggestion. I am reading data from multiple xmls and writing into one xml. So I would have iterations of same element. Thanks in advance!
 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here employee node is complex element having name,designation, sal in it; which all are simple element and employee node may repeat multiple times. Have you created XSD or DTD for this???
 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Nani,

As you are able to read the XML files, you can get the information of each employee using xpath. After that, in the same loop (in which you would be processing the individual employee's XML file one by one), you can add code to add the same elements in the newly created XML file.

Can you please pin point, at which step you are facing a problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic