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) UsingXMLReader:
User wants to read all elements in the XML File using XMLReader.
Now, we go to Coding Section.
Using XMLTextReader:
No comments:
Post a Comment