D
Dan
I'm trying to write an XmlDocument to disk using an XmlTextWriter.
Everything is fine except that I can't get the XML declaration to come out.
I'm using the code below. What am I doing wrong?
XmlTextWriter writer = new XmlTextWriter(m_FileName,
Encoding.Default);
writer.WriteStartDocument(true);
m_XMLDocument.WriteTo(writer);
writer.Flush();
writer.Close();
Everything is fine except that I can't get the XML declaration to come out.
I'm using the code below. What am I doing wrong?
XmlTextWriter writer = new XmlTextWriter(m_FileName,
Encoding.Default);
writer.WriteStartDocument(true);
m_XMLDocument.WriteTo(writer);
writer.Flush();
writer.Close();