title: Transforming XML with XSL to HTML Saxon library in .NET
body: <p>I am programming in C#. I was previously using the following command line to convert an xml with a xsl and output it as a html.</p>
  
  <blockquote>
    <p>java -jar "C:\Data\saxon-he-9.4.0.7.jar" View.xml Stylesheet.xsl -o:output.html</p>
  </blockquote>
  
  <p>However, I am now trying to use the Saxon .Net API to do the same process using the following code:</p>
  
  <pre><code>            var xslt = new FileInfo(@"C:\\Data\\Stylesheet.xsl");
              var input = new FileInfo(@"C:\\Data\\View.xml");
              var output = new FileInfo(@"C:\\Data\\test.html");
  
              // Compile stylesheet
              var processor = new Processor();
              var compiler = processor.NewXsltCompiler();
              var executable = compiler.Compile(new Uri(xslt.FullName));
  
              // Do transformation to a destination
              var destination = new DomDestination();
              using (var inputStream = input.OpenRead())
              {
                  var transformer = executable.Load();
                  transformer.SetInputStream(inputStream, new Uri(input.DirectoryName));
                  transformer.Run(destination);
              }
  
              // Save result to a file (or whatever else you wanna do)
              destination.XmlDocument.Save(output.FullName);
  </code></pre>
  
  <p>However I recieve the error:
  "An unhandled exception of type 'Saxon.Api.DynamicError' occurred in saxon9he-api.dll" 
  When running the line "transformer.Run(destination);"</p>
  
  <p><strong>The following screenshots are from the Visual Studio's Locals Debugging:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/wmKo5.png" rel="nofollow noreferrer">$exception {"XSLT 1.0 compatibility mode is not available in this configuration"}  Saxon.Api.DynamicError</a></p>
  
  <p><a href="https://i.stack.imgur.com/3NCSL.png" rel="nofollow noreferrer">transformer    {Saxon.Api.XsltTransformer} Saxon.Api.XsltTransformer</a></p>