![]() |
VOOZH | about |
dotnet add package SaxonHE12s9apiExtensions --version 12.9.10
NuGet\Install-Package SaxonHE12s9apiExtensions -Version 12.9.10
<PackageReference Include="SaxonHE12s9apiExtensions" Version="12.9.10" />
<PackageVersion Include="SaxonHE12s9apiExtensions" Version="12.9.10" />Directory.Packages.props
<PackageReference Include="SaxonHE12s9apiExtensions" />Project file
paket add SaxonHE12s9apiExtensions --version 12.9.10
#r "nuget: SaxonHE12s9apiExtensions, 12.9.10"
#:package SaxonHE12s9apiExtensions@12.9.10
#addin nuget:?package=SaxonHE12s9apiExtensions&version=12.9.10Install as a Cake Addin
#tool nuget:?package=SaxonHE12s9apiExtensions&version=12.9.10Install as a Cake Tool
Extension methods that help/ease the task of using Saxon HE 12 Java s9api from .NET code
This is a sample project outlining my successful attempt to apply https://github.com/ikvm-revived/ikvm and https://github.com/ikvm-revived/ikvm-maven to use the open-source Saxon HE 12 Java XSLT 3.0, XQuery 3.1 and XPath 3.1 library in .NET 8 or .NET 9 or .NET 10 code or .NET framework 4.8.1 or 4.8 code.
Please understand that this is my own experiment, it uses the official Saxon HE 12 release from Maven, but the integration with IKVM and IKVM Maven is an experimental work of my own, not in any way an officially tested and supported product by Saxonica, the company that has produced Saxon.
So feel free to try and use it under the Mozilla Public License 2.0.
Understand that this is work in progress and kind of experimental, I don't have access to a complete test suite of unit tests to rigorously test this, I nevertheless feel it can be useful for folks to at least know about this option to run XSLT 3.0, XPath 3.1 and XQuery 3.1 in .NET 8 or .NET 9 or .NET 10 code or .NET framework 4.8 code.
To use Saxon under .NET, the coding is mainly done against the Java s9api API of Saxon HE 12 although I have provided some extension methods as helpers to ease the task of using .NET FileInfo or Stream instead of needing to know about and use Java specific java.io.File or Stream classes/APIs.
With this new release based on IKVM 8.15.0 (preview) and IKVM.Maven.Sdk 1.10.0 IKVM uses an up to date Java 8/1.8 JDK 8u472-b08, as for .NET, first release for .NET 10, and both using and building the package on Windows (including Windows ARM) and MacOs should work.
The basic usage is to to install the NuGet package IKVM.Maven.Sdk to be able to pull in the Saxon HE 12 (12.1 and later should Java 8 and therefore IKVM compatible) from Maven:
<ItemGroup>
<PackageReference Include="IKVM.Maven.Sdk" Version="1.11.0" />
<MavenReference Include="net.sf.saxon:Saxon-HE" version="12.9.0" />
</ItemGroup>
This extension project is also on NuGet so you can add it in your project e.g.
<ItemGroup>
<PackageReference Include="IKVM.Maven.Sdk" Version="1.11.0" />
<PackageReference Include="SaxonHE12s9apiExtensions" Version="12.9.10" />
</ItemGroup>
Then you are ready to write .NET 8/9/10 or .NET framework 4.8.1 or 4.8 code against the Saxon 12 s9api API, helped by this extension library to not have to use most Java classes for input/output/URIs/URLs but to be able to use relevant .NET classes:
using net.sf.saxon.s9api;
using net.liberty_development.SaxonHE12s9apiExtensions;
//using System.Reflection;
// force loading of updated xmlresolver (hopefully no longer needed with current release Saxon HE 12.8)
//ikvm.runtime.Startup.addBootClassPathAssembly(Assembly.Load("org.xmlresolver.xmlresolver"));
//ikvm.runtime.Startup.addBootClassPathAssembly(Assembly.Load("org.xmlresolver.xmlresolver_data"));
var processor = new Processor(false);
Console.WriteLine($"{processor.getSaxonEdition()} {processor.getSaxonProductVersion()}");
var xslt30Transformer = processor.newXsltCompiler().Compile(new Uri("https://github.com/martin-honnen/martin-honnen.github.io/raw/master/xslt/processorTestHTML5Xslt3InitialTempl.xsl")).load30();
xslt30Transformer.callTemplate(null, processor.NewSerializer(Console.Out));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net48 net48 is compatible. net481 net481 is compatible. |
Showing the top 1 NuGet packages that depend on SaxonHE12s9apiExtensions:
| Package | Downloads |
|---|---|
|
Lefty.Schematron
Swiss-knife for Schematron operations, using .NET. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 12.9.10 | 9,434 | 12/7/2025 |
| 12.9.10-pre1 | 185 | 12/5/2025 |
| 12.9.1 | 935 | 9/13/2025 |
| 12.9.0 | 181 | 9/13/2025 |
| 12.8.2 | 350 | 8/16/2025 |
| 12.8.1 | 257 | 8/10/2025 |
| 12.8.0 | 213 | 7/5/2025 |
| 12.7.9 | 610 | 5/16/2025 |
| 12.5.9.9 | 570 | 2/18/2025 |
| 12.5.9.8 | 500 | 2/5/2025 |
| 12.5.9.6 | 611 | 11/13/2024 |
| 12.5.9.6-pre2 | 285 | 10/11/2024 |
| 12.5.9.6-pre1 | 257 | 9/15/2024 |
| 12.5.9.4 | 415 | 9/14/2024 |
| 12.5.9.3 | 368 | 8/21/2024 |
| 12.5.9.1 | 385 | 7/16/2024 |
| 12.5.1 | 259 | 7/13/2024 |
| 12.5.0 | 324 | 7/2/2024 |
| 12.4.8 | 1,172 | 4/17/2024 |
| 12.4.7.6 | 337 | 3/28/2024 |
This is the first release of a .NET 8, .NET 9 and .NET 10 and .NET framework 4.8.1 and .NET framework 4.8 package for Saxon HE 12.9 based on the updated IKVM 8.15.0 and IKVM.Maven.Sdk 1.11.0 (using the latest Java 8 JDK jdk8u472-b08) for better cross-platform support