Transforms XML data using an XSL stylesheet.
Object
XslTransform
[Visual Basic] Public Class XslTransform [C#] public class XslTransform [C++] public __gc class XslTransform [JScript] public class XslTransform
To transform XML data:
Namespace: System.NewXml.Xsl
Assembly: System.Xml.dll
The following example transforms the specified XML document using the specified stylesheet and outputs the result to the console using XmlWriter.
[C#]
//Create a new XslTransform XslTransform xslt = new XslTransform(); //Load an XSL stylesheet xslt.Load("http://somewhere/favorite.xsl"); //Create a new XmlDocument to load XML data from a file. XmlDocument mydata = new XmlDocument() //Load the XML data file mydata.Load("http://somewhere/mydata.xml"); //Create an XmlTextWriter to transform output to the console. XmlWriter writer = new XmlTextWriter(Console.Out); //Transform the data and output the result. xslt.Transform(new XmlDocumentNavigator(mydata),null,writer);