Step 1: Create a new Excel Application
Step 2: Press Alt + F11,it will open code behind window.
End Sub
Transform XML into HTML using XslCompiledTransform class:
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.IO;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string xmlFilePath = Request.PhysicalApplicationPath + @"App_Data\Data.xml";
string xsltPath = Request.PhysicalApplicationPath + @"App_Data\Data.xslt";
XPathDocument xPathDoc = new XPathDocument(xmlFilePath);
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(xsltPath);
transform.Transform(xPathDoc, null, Response.Output);
}
}
Output of Above page is :
Diamond Problem :
The Diamond problem is related to object oriented languages that allow multiple inheritance.As we know C# does not support multiple inheritance of classes, but it does support multiple inheritance through interfaces. Therefore, the same ambiguity may arise unless explicit interface implementation is used. Going explicitly, we can have different implementations to the same method. The problem is solved.