Search and Replace XML TAG using JAVA
843834May 12 2010 — edited May 12 2010Hi All,
I have an XML file, say RESULT.XML Which has about 30000 Lines (yes Thirty Thousand ). For some reason i need to replace an existing tag with a different tag(not the value inside the tag, But the tag itself) . I am facing a challenge. I will explain it as below.
I have a csv file which has 2 values as given below
<VALUE A> , <VALUE B>
where <VALUE A> is an existing node in the RESULT.XML and <VALUE B> is the node that should replace <VALUE A> in the RESULT.XML
i have 500 such entries in the file.
Now i need to write a program to read the csv file, Search <VALUE A> in the RESULT.XML and Replace it with <VALUE B> of the csv file.
please let me know how do i start with this.
I really want to fix this issue.
Existing Node = <Product ID="role (contact) 3" UserTypeID="Product Number">_
To be changed to = <Product ID= role (contact)3" UserTypeID="Product Number">_
please reply if you need any further information
Thanks in Advance
Manzoor