Project

Profile

Help

Bug #4740

XSLT Transform Error - .Net Core 3.1

Added by Muralidharan S 12 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
.NET API
Sprint/Milestone:
Start date:
2020-09-19
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
Fixed in Maintenance Release:

Description

Get Error in .Net core 3.1 - System.TypeInitializationException: 'The type initializer for 'sun.util.calendar.ZoneInfoFile' threw an exception'.

sample file added.

bib.xml (1.18 KB) bib.xml Muralidharan S, 2020-09-19 15:22
transform.xsl (395 Bytes) transform.xsl Muralidharan S, 2020-09-19 15:22

History

#1 Updated by Muralidharan S 12 months 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);
        }


    }

#2 Updated by Michael Kay 12 months 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.

#3 Updated by Vladimir Nesterovsky 12 months 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.

#4 Updated by Michael Kay 6 months 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

Also available in: Atom PDF