Page Rank

Subscribe

Categories

Recent posts

Alexa Rank

How to create XML file using C#


  • This topic helps how to create XML file using C# programming.
  • For creating a new XML file in C#, we are using XmlTextWriter class.
  • You have to import two NameSpaces: System.Xml, System.IO

XML (Extensible Markup Language)How to create XML file using C#

  • Extensible Markup Language (XML) is a markup language created to structure, store, and transport data by defining a set of rules for encoding documents in a format that is both human-readable and machine-readable.
  • The design goals of XML emphasize simplicity, generality, and usability over the Internet.
  • XML is a textual data format with strong support via Unicode for the languages of the world.
  • XML is developed by World Wide Web Consortium.
  • Hundreds of XML-based languages have been developed, including RSS, Atom, SOAP, and XHTML.

XmlTextWriter ClassHow to create XML file using C#

  • XmlTextWriter Class represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

  • Syntax for XmlTextWriter Class

XmlTextWriter Constructor (String, Encoding)How to create XML file using C#


  • Create an instance of the XmlTextWriter class using the specified file.
  • Syntax for XmlTextWriter Constructor

XmlTextWriter.WriteStartDocument Method (Boolean)How to create XML file using C#

  • Write the XML declaration with the version “1.0″ and the standalone attribute.
  • Syntax

XmlWriter.WriteStartElement Method (String)How to create XML file using C#

  • When overridden in a derived class, writes out a start tag with the specified local name.
  • Syntax

How to create XML file using C#Complete Code

How to create XML file using C#Output result

 If you like this topic, please provide feedback on comment box.

How to create XML file using C#


VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
How to create XML file using C#, 9.0 out of 10 based on 1 rating

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">