EDN Admin
Well-known member
we use .NET 4 and we use following code to write xml structure data into xml file, it seems too slow
XDocument doc = new XDocument(CreateLogElement(run));
XmlWriterSettings settings = new XmlWriterSettings();<br/>
settings.NewLineOnAttributes = true;<br/>
settings.Indent = true;
XmlWriter xmlWriter = XmlWriter.Create(filePath, settings);<br/>
doc.WriteTo(xmlWriter);<br/>
xmlWriter.Flush();<br/>
xmlWriter.Close();
Is this fast way to write data into xml file?
Does anybody know how to improve it?
Does anybody know what is different between XDocument and XmlDocument?
We see the following links:
http://blogs.msdn.com/b/codejunkie/archive/2008/10/08/xmldocument-vs-xelement-performance.aspx <span style="color:#0066dd http://blogs.msdn.com/b/codejunkie/archive/2008/10/08/xmldocument-vs-xelement-performance.aspx
thx! <hr class="sig JaneC
View the full article
XDocument doc = new XDocument(CreateLogElement(run));
XmlWriterSettings settings = new XmlWriterSettings();<br/>
settings.NewLineOnAttributes = true;<br/>
settings.Indent = true;
XmlWriter xmlWriter = XmlWriter.Create(filePath, settings);<br/>
doc.WriteTo(xmlWriter);<br/>
xmlWriter.Flush();<br/>
xmlWriter.Close();
Is this fast way to write data into xml file?
Does anybody know how to improve it?
Does anybody know what is different between XDocument and XmlDocument?
We see the following links:
http://blogs.msdn.com/b/codejunkie/archive/2008/10/08/xmldocument-vs-xelement-performance.aspx <span style="color:#0066dd http://blogs.msdn.com/b/codejunkie/archive/2008/10/08/xmldocument-vs-xelement-performance.aspx
thx! <hr class="sig JaneC
View the full article