Hi
I've added a new Xml-node to my XmlDocument:
XmlDocument xml = newXmlDocument();
xml.Load("books.xml");
XmlNode fragment = xml.CreateDocumentFragment();
fragment.InnerXml = "<Book><Title>MyBook</Title></Book>";
xml.DocumentElement.AppendChild(fragment);
xml.Save("books.xml");
The problem is that the added node is not correctly indented.
I want the output to be:
<Book>
<Title>
MyBook
</Title>
</Book>
How do I do this?
Kind Regards
↧
XmlDocument.Save() - Automatic indenting?
↧