Bug #4740
closedXSLT Transform Error - .Net Core 3.1
0%
Description
Get Error in .Net core 3.1 - System.TypeInitializationException: 'The type initializer for 'sun.util.calendar.ZoneInfoFile' threw an exception'.
sample file added.
Files
Updated by Muralidharan S over 4 years ago
public static void TestTransform(string xsltFile, string inputFile, string outputFile) { TextWriter writer = null; var xslt = new FileInfo(xsltFile); var input = new FileInfo(inputFile); var output = new FileInfo(outputFile);
// Compile stylesheet
var processor = new Processor(false);
var compiler = processor.NewXsltCompiler();
var executable = compiler.Compile(new Uri(xslt.FullName));
using (var inputStream = input.OpenRead())
{
var transformer = executable.Load();
transformer.SetInputStream(inputStream, new Uri(input.DirectoryName));
Serializer serializer = processor.NewSerializer(writer);
transformer.Run(serializer);
}
}
Updated by Michael Kay over 4 years ago
Sorry, but Saxon is not supported on .NET Core. This is a limitation of the IKVM technology that we use for porting Saxon from Java to .NET. We have been exploring various options that might provide a way forward on this, but we can't promise anything imminent.
Updated by Vladimir Nesterovsky over 4 years ago
Did you consider wrapping Saxon into web front end and exposing it through REST API? This would expose Saxon to a number of technologies you do not support out of the box now. It would create new optimization opportunities like allowing sharing names through whole process, and avoiding jvm warmup.
Updated by Michael Kay over 3 years ago
- Status changed from New to Closed
- Priority changed from High to Normal
Closing this. Saxon for .NET is not supported on .NET Core, due to IKVM limitations. We have a new product under development to fill this gap, see https://dev.saxonica.com/blog/mike/2021/03/saxon_cs_hello_world.html -- but of course we can offer no dates and no commitments.
Please register to edit this issue