Results 1 to 3 of 3
  1. #1
    karthik84 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default How to search and replace a tag value in xml file using java

    Hi all,

    I am new to Java XML Programming, I have a problem in writing a program for searching an xml file with a name and replace tht value with another value.
    for example:

    My xml file is:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <student>
    <stud_name>Suresh</stud_name>
    <stud_age>60</stud_age>
    </student>

    Now I have to replace the value Suresh with another name using java program, i have used DOM and SAX parsers but i am not able to compare the values of the user given with the xml file

    Any Help Very Great!!!!!!!!!!!11
    Its Really Urgent ,
    Thank you all who are viewing and replying my query.......

    Thanks Alot,
    karthik.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    karthik84 is offline Member
    Join Date
    Aug 2008
    Posts
    3
    Rep Power
    0

    Default

    Initially i have taken 2 text boxes wherein both of the text boxes we will give the values and a button for replacing the value in the second text box.Yes i have found out the element but i am not able to write the code for searching and replace the tag <stud_name>

Similar Threads

  1. Search in text file
    By mark-mlt in forum New To Java
    Replies: 6
    Last Post: 04-03-2009, 05:33 PM
  2. File Search
    By Juggler in forum New To Java
    Replies: 2
    Last Post: 07-19-2008, 05:09 PM
  3. [SOLVED] how to replace exact string in java
    By pankaj_salwan in forum New To Java
    Replies: 22
    Last Post: 07-08-2008, 10:28 AM
  4. Java 1.4 api replace for javax.activity ( java 1.5)
    By agrawal27 in forum Advanced Java
    Replies: 0
    Last Post: 12-17-2007, 08:41 PM
  5. Replies: 1
    Last Post: 06-06-2007, 05:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •