using XML to write output files

  • Thread starter Thread starter William Ryan eMVP
  • Start date Start date
Hello,

It partly depends on how your data is held. If it's in a DataSet, you can
just use its WriteXml method to do all the work for you - even easier than
using the StreamWriter!

Alternatively, have a look at the XmlWriter class.

A final thought: XML is just plain text, so you can use a StreamWriter to
write the raw XML data yourself, if you wish (ignoring the framework's
built-in XML support).
 
How much harder is it to write data to an XML file instead of an ascii file?
When I write an output data file, I usually write it as an ascii file. But
the client's been thinking of writing it in XML so the files can be used in
other processes (eg. displaying data in web).
Is writing it in XML format more time-consuming (and harder) than writing it
in a plain ascii file? I usually read/write ascii files with StreamReader
and StreamWriter classes.

Thanks.
 
Back
Top