How to create a XmlDocument using XmlWriter in .NET?

前端 未结 5 1260
傲寒
傲寒 2020-12-08 02:00

Many .NET functions use XmlWriter to output/generate xml. Outputting to a file/string/memory is a very operation:

XmlWriter xw = XmlWriter.Create(PutYourStre         


        
5条回答
  •  北海茫月
    2020-12-08 02:31

    The idea behind XmlWriter is to wait until you have finished modifying your data before you start writing.

    XmlWriter wasn't built with your situation in mind.

    Either

    • Wait until you know what your data is going to be before writing

    or

    • Do what you're currently doing

提交回复
热议问题