0 Comments

Just a code snippet for transforming an input file to an output file in C# by using XSLT:

/// <summary>
/// Transform an input file to an output file, by using XSLT.
/// </summary>
public void ExecuteTransform()
{
    string xsltFilePath = @"C:\BDATA\Transform.xsl";
    string sourceFilePath = @"C:\BDATA\input.xml";
    string destinationFilePath = @"C:\BDATA\output.xml";

    var transform = new XslCompiledTransform();
    transform.Load(xsltFilePath);
    transform.Transform(sourceFilePath, destinationFilePath);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts