The XML control is used to display an XML document. XSLT document is used to format the XML document. You can format the XML document with the Transform property.


<asp:Xml ID="Xml1" runat="server" DocumentSource="~/XMLFile.xml"  TransformSource="~/XSLTFile2.xslt" Visible="true">


In DocumentSource propertyspecify the xml file name which data you want to show on the page. And in TransformSource specify the  xslt file name which format tha xml document.


<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="XSLTFile.xslt"?>


XSLT is used to transform an XML document into another XML document. XSL stands for EXtensible Stylesheet Language. XSLT is for XSL Transformations.


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
  <xsl:template match="/">
        <h2>State in India</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
            <th>State </th>
          <xsl:for-each select="Country/cd">
                <xsl:value-of select="State" />


 Run the project


XML Control in ASP.Net

  Modified On Apr-04-2020 12:40:48 AM

Leave Comment