using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Xml;
using System.Xml.Xsl;
public class XsltTransform
{
public static void Transform()
{
SqlConnection
nwindConn = new SqlConnection("Data
Source=INMUMIS123;database=northwind;uid=sa;pwd=;");
nwindConn.Open();
DataSet
custDS = new DataSet("CustomerDataSet");
SqlDataAdapter custDA = new SqlDataAdapter("SELECT * FROM Customers",
nwindConn);
custDA.Fill(custDS, "Customers");
SqlDataAdapter ordersDA = new SqlDataAdapter("SELECT * FROM Orders",
nwindConn);
ordersDA.Fill(custDS, "Orders");
XmlDataDocument xmlDoc = new XmlDataDocument(custDS);
XslTransform
xslTran = new XslTransform();
xslTran.Load("transform.xsl");
// This is
for generating the output in new html
XmlTextWriter
writer = new XmlTextWriter("xslt_output.html",
System.Text.Encoding.UTF8);
writer.Close();
// This is
for writing in the current page
xslTran.Transform(xmlDoc, null, Response.OutputStream);