SIGN UP MEMBER LOGIN:    
ARTICLE

ASP.NET 2.0 Xml Control

Posted by Mahesh Chand Articles | ASP.NET Programming October 09, 2005
The Xml control of ASP.NET 2.0 is used to display an XML document and apply XML transformations to transform the data. This article shows how to use Xml control.
Reader Level:

ASP.NET 2.0 Xml Control is used to load and transform XML documents. The following code creates an Xml control:

<asp:Xml ID="Xml1" runat="server"></asp:Xml>

First of all, I have to say Microsoft ASP.NET team did a bad job by picking "Xml" as name of this control. An argument can be that the ASP.NET tag is asp:Xml but still, I would have picked a different name such as XmlWeb control or something.

XmlDocument property of Xml contrl can be used to set a XmlDocument object, which is created from an XML document. Another important property of Xml is DocumentSource, which can be set to an XML file and load the contents directly in the control.

The Transform property of Xml is used to set the transformation, which is an XslTransform object. The following code sets the Document and Transform property of Xml.

 XmlDocument doc = new XmlDocument();
 doc.Load(Server.MapPath("people.xml"));

 XslTransform trans = new XslTransform();
 trans.Load(Server.MapPath("peopletable.xsl"));

 xml1.Document = doc;
 xml1.Transform = trans

Login to add your contents and source code to this article
share this article :
post comment
 

hi,

 

i want to read an xml file through smart device apllication in .net

and facing the problen in finding path of xml file.i dont know where my file is or any other problen must be there plz give me reply as soon as possble its urgent.

                                                                                   yasha tiwari

Posted by yasha tiwari Jul 01, 2006
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor