I'm working on a program that stores some of its configuration information in an XML file. I'm able to read and write the xml files ok and everything works, but I would like to be able to open the xml files in other programs such as programmer's notepad. When I open the xml file in programmer's notepad, all the text is on a single line.
Is there a way to embed carriage returns into the xml file?
Here's an example of how I'm writing the xml file:
Thanks
Is there a way to embed carriage returns into the xml file?
Here's an example of how I'm writing the xml file:
VB.NET:
DataManifest = New XmlDocument
Dim myxmldeclaration As XmlDeclaration
myxmldeclaration = DataManifest.CreateXmlDeclaration("1.0", "UTF-8", "yes")
DataManifest.AppendChild(myxmldeclaration)
root = DataManifest.CreateElement("FILE_INFORMATION")
subchild = DataManifest.CreateElement("VERSION")
subchild.InnerText = "2.0"
root.AppendChild(subchild)
subchild = DataManifest.CreateElement("RECORD_DATE")
subchild.InnerText = Now.ToString("yyyyMMdd")
root.AppendChild(subchild)
subchild = DataManifest.CreateElement("RECORD_TIME")
subchild.InnerText = Now.ToString("HH:mm:ss")
root.AppendChild(subchild)
childevents = DataManifest.CreateElement("EVENTS")
root.AppendChild(childevents)
DataManifest.AppendChild(root)
Dim output As New XmlTextWriter(mediapath + "EVENT_MANIFEST.xml", System.Text.Encoding.UTF8)
DataManifest.WriteTo(output)
output.Close()
Thanks