• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inserting a node in an existing xml document

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

i need to insert a new element in an existing xml document.This is my sample xml document..




I'll get get the node name that has to be and its value and the position to add the node all in run time only.
I'm displaying the xml in a form display in a jsp page and i have a check box for every node. So when i click a node i'll display the elements that can be added under that corresponding node using the DTD of that xml.
Hereby i'm getting the node name its textvalue and Xpath..
I couln't get the xpath correctly and so i couln't add that element in the proper node.
Here is my code....
It adds the node name and node value but not in the correct location...It adds under the first <person> even if i select second <person>



i'm going wrong in the nodepath as i'm retrieving the nodepath as "/folks/person/name".. it cant identify the exact <person> and so it considers the first <person>

Can you give me any idea to solve this issue?

Thanks in advance,
Indu



 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on which XML library you're using this thread will be moved to a sensible forum.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"indu ss", please check your private messages for an important administrative matter.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, please take the time to choose the correct forum for your posts. This forum is for questions on Servlets. For more information, please read this.

This post has been moved to a more appropriate forum.
 
please buy this thing and then I get a fat cut of the action:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic