最简单的XML运用

80酷酷网    80kuku.com

  xmlXML控件:
  protected System.Web.UI.WebControls.Xml xmlList;

数据源梆定:
=============================

   xmlList.DocumentSource = "TestXml.xml";
   xmlList.TransformSource = "TestXsl.xslt";
   xmlList.DataBind();

=============================

数据对像调用,生成HTML文件。

=============================

   XmlDocument doc = new XmlDocument();
   doc.Load(Server.MapPath("TestXml.xml"));
   XslTransform trans = new XslTransform();
   trans.Load(Server.MapPath("TestXsl.xslt"));
   xmlList.Document = doc;
   xmlList.Transform = trans;
   trans.Transform(Server.MapPath("TestXml.xml"),Server.MapPath("TextHtml.html"));

=============================



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: