SaxonHE11s9apiExtensions 11.6.8.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package SaxonHE11s9apiExtensions --version 11.6.8.9                
NuGet\Install-Package SaxonHE11s9apiExtensions -Version 11.6.8.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SaxonHE11s9apiExtensions" Version="11.6.8.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SaxonHE11s9apiExtensions --version 11.6.8.9                
#r "nuget: SaxonHE11s9apiExtensions, 11.6.8.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SaxonHE11s9apiExtensions as a Cake Addin
#addin nuget:?package=SaxonHE11s9apiExtensions&version=11.6.8.9

// Install SaxonHE11s9apiExtensions as a Cake Tool
#tool nuget:?package=SaxonHE11s9apiExtensions&version=11.6.8.9                

Saxon HE 11 s9api .NET extension method helpers

Extension methods that help/ease the task of using Saxon HE 11 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 11 Java XSLT 3.0, XQuery 3.1 and XPath 3.1 library in .NET 6 code or .NET framework 4.8 code.

Please understand that this is my own experiment, it uses the official Saxon HE 11 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.

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 6 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 11 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 using IKVM 8.7.3 and IKMV.Maven.Sdk 1.6.2, it should now be possible to both use and build the packages under Windows as well as MacOs.

The basic usage is to to install the NuGet package IKVM.Maven.Sdk to be able to pull in the Saxon HE 11 (e.g. 11.6) and the XmlResolver code it uses directly from Maven:

  <ItemGroup>
    <PackageReference Include="IKVM.Maven.Sdk" Version="1.6.2" />
    <MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />
    
  </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.6.2" />
    <PackageReference Include="SaxonHE11s9apiExtensions" Version="11.6.8.9" />
    <MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />
    
  </ItemGroup>

Then you are ready to write .NET 6 code against the Saxon 11 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.SaxonHE11s9apiExtensions;
using System.Reflection;

// force loading of updated xmlresolver (hopefully no longer needed with Saxon HE 11.6)
//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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
11.6.11 920 8/21/2024
11.6.10 99 7/28/2024
11.6.9 3,815 5/19/2024
11.6.8.9 2,640 12/10/2023
11.6.8.8 123 12/9/2023
11.6.8.7 1,483 11/10/2023
11.6.1 296 8/24/2023
11.6.0 195 8/24/2023
11.5.1 4,667 2/25/2023
11.5.0 920 2/9/2023
11.4.0.3 338 2/1/2023
11.4.0.2 519 11/16/2022
11.4.0.1 362 11/16/2022
11.4.0 439 11/2/2022
11.4.0-alpha6 254 9/15/2022
11.4.0-alpha5 233 9/15/2022
11.4.0-alpha4 227 9/14/2022
11.4.0-alpha3 254 9/14/2022

This is the first release using Saxon HE 11.6 targetting both .NET framework 4.8 as well as .NET 6, using IKVM 8.7.3 and IKVM.Maven.Sdk 1.6.2