Monday, February 6, 2012

ASP.net with XML



Basic of XML
The acronym XML stands for extensible markup language. It is called extendible because you can extend it according to your wish. There is no pre define tag in XML. You can generate your won tag to describe and represent data. XML is very much user friendly and easy to parse using many programming languages(C#,PHP,JSP,JavaScript etc can able to parse XML easily). XML is w3c recommended. Generally it is  used for transfer data.
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 >
A simple example of XML file
<person>
  <name>sourav</name>
<surname>kayal</kayal>
<course>MCA</course>
</person>

Some points about XML
  •        XML is self descript language
  •         XML is case sensitive
  •         XML is truly platform independent
  •         Most of the programming language can parse XML data
  •         XML is used for represent and transfer data
  •         XML can able to parse like a tree
  •         There is one and only one root element in XML
Example of XML tree is
dom-full.gif

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.

No comments:

Post a Comment