Installation: .NET platform
This section explains in more detail how to install SaxonCS on the .NET platform. For a basic "quick start" guide, see Getting started with SaxonCS.
For more information about SaxonCS on the .NET platform, see SaxonCS.
Prerequisites: .NET platform
The following software must be installed separately, it is not included with the Saxon download.
To run SaxonCS you need to install .NET 5. This is the only release on which the product has been validated; if you want to try it on other versions, please let us know your experience.
SaxonCS validation has taken place primarily on MacOS, with extensive regression testing on Windows and Linux. It is supported on all three platforms.
Installing the software
The software is designed to be installed using Nuget, in which case all its dependencies will be automatically loaded as well. It consists of a single DLL file, named SaxonCS.
To invoke SaxonCS from a C# application, simply add a Nuget dependency to your project as you would for any other third-party library.
To run XSLT transformations, XQuery queries, or XSD validation from the command line, two approaches are possible:
Firstly, having installed the DLL using Nuget, you can use the dotnet command, for example:dotnet SaxonCS transform -t -s:source.xml -xsl:stylesheet.xsl
Alternatively, executables are available for specific platforms from https://www.saxonica.com/download/dotnet.xml. Having installed the right executable for your target platform, you can invoke it directly using a command such as:SaxonCS transform -t -s:source.xml -xsl:stylesheet.xsl
Before you can run the software, you will need to ensure that a license file is installed, as described in Setting up a license key.
SaxonCS is distributed with a sample application
a variety of use cases for invoking the Saxon API to perform queries and transformations.
This is issued
(together with this documentation and other resources) in a separate download file
saxon-resources-11.zip, available from the Saxonica
website. Once this is unzipped, the sample applications can be found in the directory
/samples. They are described in Samples.
As well as the
Example.cs application, the issued samples include a variety
of simple XML documents, schemas, stylesheets, and queries, which can be used to gain
familiarity with the command line interface. They are described in Samples.