Next


XML

• XML stands for “Extensible Markup Language”.
• It is also a markup language, just like HTML, which contains tags.
• But unlike HTML, the XML contains no pre-defined tags. It contains only user-defined tags.
• This xml code can be written in a file with “.xml” file.
• This is used to describe the data in a structured format.
• Generally, xml documents are portable, in order to share the data among two projects developed in different languages.
Ex: employees.xml

<employees>
      <emp>
            <empid>101</empid>
            <empname>Ram</empname>
            <salary>8739</salary>
      </emp>
      <emp>
            <empid>102</empid>
            <empname>Sita</empname>
            <salary>6782</salary>
      </emp>
      <emp>
            <empid>103</empid>
            <empname>Laxman</empname>
            <salary>7832</salary>
      </emp>
</employees>


Working with XML files in ASP.NET
• “DataSet” buffer offers to interact with the xml files.
• It allows to read the data from the xml files and also to write the data to xml files.
• Reading data from xml document into DataSet:
ds.ReadXml(“xml file path”);
• Writing data to xml document from DataSet:
ds.WriteXml(“xml file path”);