Live Chat Icon For mobile
Live Chat Icon

How to save an xml-string into an Xml document

Platform: ASP.NET| Category: XML

VB.NET


Dim xmlText As String = 'Node1Node2'
Dim xmlDoc As New XmlDocument
xmlDoc.LoadXml(xmlText)
Dim writer As XmlTextWriter = New XmlTextWriter(Server.MapPath('data.xml'), Nothing)
writer.Formatting = Formatting.Indented
xmlDoc.Save(writer)

C#


string xmlText = 'Node1Node2';
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlText);
XmlTextWriter writer = new XmlTextWriter(Server.MapPath('data.xml'),null);
writer.Formatting = Formatting.Indented;
xmlDoc.Save(writer);

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.