Actually i need to replace some of the tags in source xml and write the files as new one. Here my code works fine but now am not able to open the output xml. In the output xml i have some tamil words. Is it the reason for file not opening
public class dxml {
public static StringBuffer sb = new StringBuffer() ;
public static void main(String [] args) throws Exception {
File xmlFile = new File("/home/dev702/Desktop/axl/Data Entry.xml");
BufferedReader br = new BufferedReader(
new FileReader("/home/dev702/Desktop/axl/Data Entry.xml"));
String line = null;
int linecount = 1;
FileWriter fw;
BufferedWriter bw = null;
fw = new FileWriter("/home/dev702/Desktop/axl/Data_Entry_OPT.xml") ;
bw = new BufferedWriter(fw);
while((line = br.readLine())!= null)
{
if(linecount > 2)
{
line = line.replaceAll("Data_x0020_Entry_x0020_Date",
"DataEntryDate");
//bw.write(line);
}
bw.write(line);
linecount++;
System.out.println(line);
}
bw.close();
fw.close();
}
}