Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

reading xml file

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you outputting this?
 
imran quazi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at this very simmilar post, paying particular attention to what Thomas Murphy says about ther FileWriter class.
 
imran quazi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks a lot. I'm checking with it.


Imran.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic