• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML Data Manipulation  RSS feed

 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading a XML file line by line as string. Now I wanted to manipulate the XML Data such that I can to pull up some data from the child Node and append into the parent Node and erase the child node which data I have appended. I can successfully write the whole Xml file. But I am not really sure how to append the the child data inside the parent Node. I would appreciate if someone can help me out.
For Example:
XML Data:


My Intension:


Here is my code where I am reading the XML Data line by line as a string.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would be *much* better off treating XML as XML, and not as strings--start there.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!