.NET contains number of classes that support XML. ALl of these classes make working with XML as easy as understanding XML. i am going to create xml using XmlTextWriter class.
The XmlTextWriter class allows you to write XML to a file. This class contains number of methods and properties.
WriteStartDocument- Writes the XML declaration with the version "1.0".
WriteEndDocument- Closes any open elements.
Close- Closes the stream.
WriteStartElement- Writes the specified start tag.
WriteEndElement- Closes one element.
WriteStartAttribute- Writes the start of an attribute.
WriteEndAttribute- Closes the previous WriteStartAttribute call.
WriteString: Writes a string.
code behind
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml;
namespace Forumasp { public partial class XML : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
Anonymous User
04-Jan-2016a
.NET contains number of classes that support XML.
ALl of these classes make working with XML as easy as understanding XML.
i am going to create xml using XmlTextWriter class.
The XmlTextWriter class allows you to write XML to a file.
This class contains number of methods and properties.
WriteStartDocument- Writes the XML declaration with the version "1.0".
WriteEndDocument- Closes any open elements.
Close- Closes the stream.
WriteStartElement- Writes the specified start tag.
WriteEndElement- Closes one element.
WriteStartAttribute- Writes the start of an attribute.
WriteEndAttribute- Closes the previous WriteStartAttribute call.
WriteString: Writes a string.
code behind
Result