Skip to content

Commit

Permalink
Update to latest IKVM and IKVM.Maven.Sdk to get better cross-platform…
Browse files Browse the repository at this point in the history
… support for using and building the package
  • Loading branch information
martin-honnen committed Nov 10, 2023
1 parent 8e3aa83 commit fa77f0d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion SaxonHE11s9apiExtensions/DotNetInputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


using System.IO;
using JInputStream = java.io.InputStream;

namespace net.liberty_development.SaxonHE11s9apiExtensions
Expand Down
1 change: 1 addition & 0 deletions SaxonHE11s9apiExtensions/DotNetOutputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using System.IO;
using JOutputStream = java.io.OutputStream;

namespace net.liberty_development.SaxonHE11s9apiExtensions
Expand Down
3 changes: 3 additions & 0 deletions SaxonHE11s9apiExtensions/DotNetWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
using JWriter = java.io.Writer;
using JException = java.lang.Exception;

using System.IO;
using System;

namespace net.liberty_development.SaxonHE11s9apiExtensions
{

Expand Down
12 changes: 6 additions & 6 deletions SaxonHE11s9apiExtensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
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.
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](https://www.w3.org/TR/xslt-30/), [XPath 3.1](https://www.w3.org/TR/xpath-31/) and [XQuery 3.1](https://www.w3.org/TR/xquery-31/) in .NET 6 code.
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](https://www.w3.org/TR/xslt-30/), [XPath 3.1](https://www.w3.org/TR/xpath-31/) and [XQuery 3.1](https://www.w3.org/TR/xquery-31/) 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.

Known issues: I have created the project with VS 2022 Community Edition on Windows, apps built that way could be deployed and run successfully under Linux or Mac where the dotnet .NET 6 runtime is installed; however, the https://github.com/ikvm-revived/ikvm-maven does seem to work on a Mac, so in experiments of your own you will probably be restricted to develop and build on Windows.
With this new release using IKVM 8.7.1 and IKMV.Maven.Sdk 1.6.1, 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.5.5" />
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.1" />
<MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />
<!--<MavenReference Include="org.xmlresolver:xmlresolver" Version="4.5.1" />
<MavenReference Include="org.xmlresolver:xmlresolver" Category="data" Version="4.5.1" />-->
Expand All @@ -28,8 +28,8 @@ 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.5.5" />
<PackageReference Include="SaxonHE11s9apiExtensions" Version="11.6.0" />
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.1" />
<PackageReference Include="SaxonHE11s9apiExtensions" Version="11.6.8.7" />
<MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />
<!--<MavenReference Include="org.xmlresolver:xmlresolver" Version="4.5.1" />
<MavenReference Include="org.xmlresolver:xmlresolver" Category="data" Version="4.5.1" />-->
Expand Down
2 changes: 2 additions & 0 deletions SaxonHE11s9apiExtensions/S9ApiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using URL = java.net.URL;
using URI = java.net.URI;
using Source = javax.xml.transform.Source;
using System;
using System.IO;

namespace net.liberty_development.SaxonHE11s9apiExtensions
{
Expand Down
14 changes: 7 additions & 7 deletions SaxonHE11s9apiExtensions/SaxonHE11s9apiExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFrameworks>net6.0;net48</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<Title>Saxon HE 11 s9api Extension Helpers to use IKVM compiled Saxon HE 11 with .NET 6</Title>
<Version>11.6.0</Version>
<Title>Saxon HE 11 s9api Extension Helpers to use IKVM compiled Saxon HE 11 with .NET 6 and .NET framework 4.8</Title>
<Version>11.6.8.7</Version>
<Authors>Martin Honnen</Authors>
<Description>This is an extension method library to ease the use of an IKVM compiled version of Saxon HE 11 Java in .NET 6 applications.</Description>
<Copyright>Copyright 2023 Martin Honnen</Copyright>
<PackageTags>xslt;XSLT;xpath;XPath;xquery;XQuery;xslt-3.0;XSLT-3.0;xquery-3.1;XQuery-3.1;xpath-3.1;XPath-3.1;json</PackageTags>
<PackageReleaseNotes>This is the first release using Saxon HE 11.6</PackageReleaseNotes>
<PackageReleaseNotes>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.1 and IKVM.Maven.Sdk 1.6.1</PackageReleaseNotes>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/martin-honnen/SaxonHE11s9apiExtensions</RepositoryUrl>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IKVM.Maven.Sdk" Version="1.5.5" />
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.1" />
<MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />
<!--<MavenReference Include="org.xmlresolver:xmlresolver" Version="4.5.1" />
<MavenReference Include="org.xmlresolver:xmlresolver" Category="data" Version="4.5.1" />-->
Expand Down

0 comments on commit fa77f0d

Please sign in to comment.