您可以使用System.Xml.XslC#中的XSLT.
这里有一篇文章:在C#中使用Xslt进行XML转换,解释了如何 - 这是它的核心:
XPathDocument myXPathDoc = new XPathDocument(<xml file path>);
XslTransform myXslTrans = new XslTransform();
myXslTrans.Load(<xsl file path>);
XmlTextWriter myWriter = new XmlTextWriter("result.html", null);
myXslTrans.Transform(myXPathDoc, null, myWriter);
Run Code Online (Sandbox Code Playgroud)
(编辑:注意@John:该代码说明了基本思想.它并不假装是生产质量.)
| 归档时间: |
|
| 查看次数: |
243 次 |
| 最近记录: |