Mega Code Archive

 
Categories / C# Tutorial / XML
 

XPath XSLT transformation

using System; using System.Xml; using System.Xml.Xsl; using System.Xml.XPath;   class MainClass {     [STAThread]     static void Main(string[] args) {       XslTransform xslTransform = new XslTransform();       XPathDocument xpathDocument = new XPathDocument("../../sample.xml");       XmlTextWriter xmlTextWriter = new XmlTextWriter("../../sample.html", null);       xslTransform.Load("../../sample.xslt");       xslTransform.Transform(xpathDocument, null, xmlTextWriter);     }   }