Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a sample code make use of xmltext writer



write a sample code make use of xmltext writer..

Answer / career.tina@yahoo.co.in

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
//creating a apth for writing xml
string xml1 = Server.MapPath("test2.xml");
//initialising xmlwriter
XmlTextWriter xt = new XmlTextWriter(xml1,
System.Text.Encoding.UTF8);
xt.Formatting = System.Xml.Formatting.Indented;
//start writing it
xt.WriteStartDocument();
//element
xt.WriteStartElement("name");
// attribute
xt.WriteAttributeString("my_name", "name");
xt.WriteStartElement("phn");
xt.WriteAttributeString("my_phn", "266549560");
xt.WriteStartElement("id");
xt.WriteAttributeString("my_id", "100");
xt.WriteStartElement("city");
xt.WriteAttributeString("my_city", "city");
xt.WriteElementString ("title","gud girl");
//ending all elements
xt.WriteEndElement ();
xt.WriteEndElement();
xt.WriteEndElement();
xt.WriteEndElement();
xt.WriteEndDocument();
xt.Close ();

}
catch
{
}

}
}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

Types of optimization and name a few and how do u do?

1 Answers   Accenture,


What methods are fired during the page load?

2 Answers  


Differentiate between a hyperlink control and a linkbutton control.

0 Answers  


Can we have multiple worker process in an ASP.NET application? If so then how it has been handled by application? And who handles it?

0 Answers   InfoAxon Technologies,


What are cao and sao.

0 Answers  


What Are The Difference Between AutoEventWireup="true" and AutoEventWireup="False"

12 Answers   Phoenix Technologies,


How to set the pane area to transparent of a scrollPane component.?

0 Answers   MCN Solutions,


What is the difference between an EXE and a DLL?

18 Answers   Infosys, JK Associates, Persistent, TATA, Technosoft, Wipro,


What is an application domain ?

2 Answers   Microsoft,


About CLS and CTS?

8 Answers   Microsoft, Syncfusion,


can u debug application programatically? if yes how?

0 Answers   FactorH,


Is It Possible For Whole Page is Saved In View State? What Is View State?

2 Answers   Phoenix Technologies,


Categories