• Post Reply Bookmark Topic Watch Topic
  • New Topic

reading XML file  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here I don't mean parsing.

The following code works fine for text file but not for XML. In case of XML, it gives some vague output.



What's the right way.
TIA.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it gives some vague output

What does that mean? Show us a short input file and the output it writes.

Generally, you'd read XML files with an XML parser, which handles all I/O details for you. What are you trying to do by reading it like this?
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:

What does that mean? Show us a short input file and the output it writes.

Generally, you'd read XML files with an XML parser, which handles all I/O details for you. What are you trying to do by reading it like this?


Surprisingly when I created a sample XML file to post here, the program worked, then I got the idea that it must be an encoding issue. Now I got it printed as it is.

Thanks Ulf.

I actually want to send this XML as Ajax response so I want it to be in string buffer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!