How to XML in C#
XML is a general purpose tag based language and very easy to transfer and store data across applications. Like HTML , XML is a subset of SGML (Standard Generalized Markup Language). XML is a platform independent language, so the information formatted in XML can be used in any other platforms (Operating Systems). XML is a self describing language and it gives the data as well as the rules to identify what information it contains.
XML files are made up of tags that contains data. Generally a start tag and end tag to hold the data. For example, if you want to create an XML tag name "Header" , the start tag is like < Header > and the end tag is like < /Header > . We can fill our information between these tags.
< Header > Header Content Here < /Header >
While creating an XML file , some important points have to remember :
* XML is case sensitive
ex: < Header > is not same as < HeadeR > .
* Tags must be closed in the reverse order that they were opened
ex : < first-tag >< second-tag > Data here < /second-tag > < /first-tag >
Sample XML File
The .Net technology is widely supported XML file format. The .Net Framework provides the Classes for read, write, and other operations in XML formatted files . These classes are stored in the namespaces like System.Xml, System.Xml.Schema, System.Xml.Serialization, System.Xml.XPath, System.Xml.Xsl etc. The Dataset in ADO.NET uses XML as its internal storage format.
You can use any text editor to create an XML file . More over XML files are readable by humans as well as computers. From the following links you can see how to use XML in C# Programming Language.
- How to create an XML file in C#
- How to open and read XML file in C# , XmlReader , XmlTextReader , XmlDocument
- How to create XML file from Dataset
- How to Open and read an XML file to Dataset
- How to create an XML file from SQL
- How to search in a XML file
- How to filter in a XML file
- How to insert data from XML to database
- How to create Excel file from XML
- How to create XML file from Excel
- How to XML to DataGridView
- How to create a TreeView from XML File
- How to create a Crystal Reports from XML File
- XML Serialization Tutorial
- XML Serialization
- XML DeSerialization