试试XslTransform类:XslTransform xslt = new XslTransform();
xslt.Load("http://somewhere/favorite.xsl");
XPathDocument xpathdocument = new
XPathDocument("http://somewhere/mydata.xml");
XmlTextWriter writer = new XmlTextWriter(Console.Out);
writer.Formatting=Formatting.Indented;
xslt.Transform(xpathdocument, null, writer);以上是从msdn的ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconxslttransformationswithxsltransformclass.htm拷贝出来的.
xslt.Load("http://somewhere/favorite.xsl");
XPathDocument xpathdocument = new
XPathDocument("http://somewhere/mydata.xml");
XmlTextWriter writer = new XmlTextWriter(Console.Out);
writer.Formatting=Formatting.Indented;
xslt.Transform(xpathdocument, null, writer);以上是从msdn的ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconxslttransformationswithxsltransformclass.htm拷贝出来的.
The System.Xml.Xsl namespace provides support for Extensible Stylesheet Transformation (XSLT) transforms. It supports the W3C XSL Transformations (XSLT) Version 1.0 Recommendation (www.w3.org/TR/xslt).