• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

adding and removing elements from DOM in java

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have written a program that store address book information in a XML file. I can read the data into a dom tree and navigate up and down the tree when a user presses a button to display the next entry. I want to be able to add and delete elements. I am having trouble getting this. the structure of my XML is as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<Address_Book>
<entry>
<fName>first name</fName>
<lName>last name</lName>
<address1>first part</address1>
<address2>first part</address2>
<city>city</city>
<state>state</state>
<zip>zip</zip>
<phone>phone</phone>
<cell>cellphone</cell>
<email>email address</email>
<notes>this is important</notes>
</entry>
</Address_Book>

Only I have multiple entry elements with listed children. I would like to be ableo to remove an entry section with all children and add one as well with the children. Any help is appreciated.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you seen JavaAlmanac.com?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless I totally misunderstand your problem, all the methods you want are in org.w3c.org.Node Interface.
Bill
 
Brandon Broschinsky
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to all the replies I got it figured out. I was running into issues about where to add the new nodes.

Thanks
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic