Hello, I am using XMLTextWriter in my VB.net file to build XML file. How do I make sure that the writer writes the elements in new line. As I am building XML file based on values from the database it sometimes will build xml for 100 or more records and some elements are breaking up and appearing in two lines.
How do I make sure that it writes xml elements in new lines always.
Dim memory_stream As New MemoryStream()
Dim settings As XmlWriterSettings = New XmlWriterSettings()
settings.Indent = True
settings.NewLineOnAttributes = True
settings.Encoding = UTF8Encoding.Default
Dim xml_text_writer As XmlWriter
xml_text_writer = XmlWriter.Create(memory_stream, settings)