当前位置:编程学习 > asp >>

[ASP/ASP.net]最简单的XML运用

XML控件:
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"));
=============================

补充:asp教程,XML相关
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,