| Author |
reading xml file
|
imran quazi
Greenhorn
Joined: Dec 01, 2006
Posts: 18
|
|
Hi All, i'm trying to read an xml file with special character in it. but the output is not showing those special characters. can anybody help me in this matter? Regards
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
How are you outputting this?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
imran quazi
Greenhorn
Joined: Dec 01, 2006
Posts: 18
|
|
Hi, I'm writing here the following codes...but still i'm not able to encode and decode the special characters like opening & closing quotation(curly, not the usual type)... =================================================== FileReader fr = new FileReader("D:/original/br11.xml"); FileWriter f0 = new FileWriter("D:/original/xyz.xml"); BufferedReader br = new BufferedReader(fr); while((s = br.readLine()) != null) { System.out.println(s.trim()); String encoded_text = URLUTF8Encoder.encode(s); System.out.println(encoded_text); String finalDecoded=unescape(encoded_text); System.out.println(finalDecoded); f0.write(finalDecoded); f0.write(s); f0.write("\n"); } fr.close(); f0.close();
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Have a look at this very simmilar post, paying particular attention to what Thomas Murphy says about ther FileWriter class.
|
 |
imran quazi
Greenhorn
Joined: Dec 01, 2006
Posts: 18
|
|
Hi Paul, Thanks a lot. I'm checking with it. Imran.
|
 |
 |
|
|
subject: reading xml file
|
|
|