using System;
using System.Xml;
using System.Xml.Xsl;
namespace XSLTransformation
{
/// Summary description for XSLTransformation.
class Class1
{
static void Main(string[] args)
{
XslTransform myXslTransform;
myXslTransform = new XslTransform();
myXslTransform.Load(Server.MapPath("~/xsl.xsl"));
myXslTransform.Transform(Server.MapPath("~/xml.xml"), Server.MapPath("~/new.xml"));
}
}
}
How to apply an XSL transformation to an XML document by using Csharp
To apply an Extensible Stylesheet Language (XSL) Transformation (XSLT) to an Extensible Markup Language (XML) document by using the XslTransform class to create a new XML document. XSL is an XML-based language that is designed to transform one XML document into another XML document or an XML document into any other structured document.
Code Snippet below: