using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace 网页数据和渲染
{
public partial class FrmMain : Form
{
public FrmMain ()
{
InitializeComponent ();
}
private void button1_Click (object sender,EventArgs e)
{
XmlDocument xml = new XmlDocument ();
xml.Load ("1.xml");
XmlDocument xsl = new XmlDocument ();
xsl.Load ("1.xsl");
//XslCompiledTransform xslt = new XslCompiledTransform ();
//xslt.Load ("1.xsl");
transformToHtml (xsl,xml);
}
private string transformToHtml (System.Xml.XmlDocument xsl,System.Xml.XmlDocument xml)
{
System.IO.StringWriter output = new System.IO.StringWriter ();
System.Xml.Xsl.XslTransform transForm = new System.Xml.Xsl.XslTransform ();
transForm.Load (xsl.CreateNavigator ());
transForm.Transform (xml.CreateNavigator (),null,output);
string transHtml = output.ToString ();
return "";
}
}
}