writing into existing XML file through java code

java , xml Dārjiling, India
  • 12 years ago

    i want to enter data into XML file through java code.
    eg: if i have Book.xml as:
    <book>
    <person>
    <first>Kiran</first>
    <last>Pai</last>
    </person>
    <person>
    <first>Bill</first>
    <last>Gates</last>
    </person>
    </book>

    I want to replace/enter first name and last name values through java code . ie Kiran should be replaced by the value given in java code...

     can someone give simple java code to write into this file 

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray