2

I am generating an xml file using php, and saving the file as :

  file_put_contents(filename,$xml->asXML());

When I open this file in browser, it shown in proper order. But when I open it in vim, it is showing at a go, i.e. without any breaks. Pretty much like this :

  <xml><Topology><a></a><b></b></Topology></xml>

I want to resolve this, i.e. I want the xml file to be shown childwise, as shown in the browser. Is there any way to do this?

L00_Cyph3r
  • 669
  • 4
  • 18
  • You probably refer to line breaks? Please learn that different operating systems use different codes for line breaks. You have to decide which to use. Most common are `\n` (unixoid, so e.g. Linux) `\r\n` (MS-Windows). Obviously Linux based systems get along with the MS-Windows variant, but not vice versa. – arkascha Sep 21 '16 at 13:16
  • Yes. Thanks a lot!!!! – Prasita Mukherjee Sep 21 '16 at 13:25
  • Browsers aren't text editors; they're often expected to format stuff before displaying it. Don't trust the rendered view to inspect raw data. – Álvaro González Sep 21 '16 at 14:36

0 Answers0