How to use XML on Server

In this example I will explain that how to use XML on Server
  • 1718

XML on the Server

  • XML is a Extensible Markup Language.

  • XML files are text file just like a HTML files.

  • XML can be generated and stored by a standard web server

  • XML makes extensive use of tags and attribute.

  • XML is a lot more flexible. you can make up own tags and attribute.

XML Declaration

In the following example I am describe the XML declaration.

<?xml version="1.0" encoding="UTF-8" ?>
<note>
  <title>MCN Solution</title>
  <description>MCN Solution is the Software Company</description>
</note>

Generating XML in C#

<% XmlTextWriter writer = new XmlTextWriter("employe.xml", System.Text.Encoding.UTF8);
             writer.WriteStartDocument(true);
             writer.Formatting = Formatting.Indented;
             writer.Indentation = 2;
             writer.WriteStartElement("Table");
             createNode("101", "Dinesh", "1000", writer);
             createNode("102", "Manish", "2000", writer);
             createNode("103", "Rahul", "3000", writer);
             createNode("104", "Nitin", "4000", writer);
             writer.WriteEndElement();
             writer.WriteEndDocument();
             writer.Close();
             MessageBox.Show("XML File created ! "); %>

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

 

 

© 2019 DotNetHeaven. All rights reserved.