h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Basic XML


Introduction:
· XML -- eXtendable Markup Language.
· It is a Case Sensitive.
· It is a Tag Code.
· Easily, it understands by Machine and Human.
· Storing and Retrieving data.
· All elements can have text content and attributes
XML Code likes this
<FirstName></FirstName>
   Structure of XML:


Root Element:
              It is a Parent Element of all Elements.
ATTRIBUTES:
             Additional information about an element.
ELEMENTS:
              It can be extended and carry more information.
              It can have attributes.
TEXT:
              Value of Every Element. User can Read, Write and Modify.
Create XML file in C#.Net:
Declare a namespace for XML
using System.Xml;
using System.IO;





User can create XML file using XMLWriter.




XML File created in the D Driver.


Read XML File Data:

  User can read XML file in two ways.
1)     Using XMLReader
2)     Using SelectSingleNode
1)     Using XMLReader:
              User wants to read all elements in the XML File using XMLReader.
Now, we go to Coding Section.
Using XMLTextReader: