AltovaGen 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package AltovaGen --version 2.0.2
                    
NuGet\Install-Package AltovaGen -Version 2.0.2
                    
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.

                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.

                    
Directory.Packages.props

                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AltovaGen --version 2.0.2
                    
#r "nuget: AltovaGen, 2.0.2"
                    
#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.
#:package AltovaGen@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AltovaGen&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=AltovaGen&version=2.0.2
                    
Install as a Cake Tool

AltovaGen

What is AltovaGen?

This library provides a managed, AnyCPU .NET 8+ API compatible with Altova.AltovaXML.dll (the COM interop wrapper from Altova XMLSpy 2026). Zero COM dependencies, fully cross-platform (Windows, Linux, macOS).

Features

Engine XSLT XQuery XSD DTD Comments
BCL (default) 1.0 1.0 subset (XPath 1.0) 1.0 Well-formedness Built-in, no external dependencies
SaxonCS-HE (bundled) 2.0/3.0 — — — altova:evaluate bridge; XQuery/XSD 1.1 not wired

Usage

The public API is interfaces only — implementation classes are internal. Register the services and resolve the facades:

using AltovaGen.Compat;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddAltovaGen();
using var provider = services.BuildServiceProvider();

// The IApplication facade mirrors the original Altova.AltovaXML surface
var app = provider.GetRequiredService();

app.XSLT1.InputXMLFromText = "Test";
app.XSLT1.XSLFromText = """
    
      
      
    
    """;

string result = app.XSLT1.ExecuteAndGetResultAsString();
// result == "Test"

XSLT 2.0/3.0

Use IXSLT2 for stylesheets that need XSLT 2.0/3.0 or the Altova extension namespace xmlns:altova="http://www.w3.org/.../xslt-extensions". It is routed to the bundled SaxonCS-HE engine:

var xslt2 = provider.GetRequiredService();
xslt2.InputXMLFileName = "sales.xml";
xslt2.XSLFileName      = "sales-report.xslt";
xslt2.Execute("sales-report.fo");

Validation

var validator = provider.GetRequiredService();
validator.InputXMLFromText = xmlContent;
validator.SchemaFromText   = xsdContent;

bool isValid = validator.IsValid();

Engines are constructor-injected into the router, so IEngineRouter.SelectXsltEngine(2.0) returns the same SaxonXsltEngine instance the container registered — XSLT 2.0/3.0 (and the altova:evaluate bridge) work out of the box, with no manual registration call.

To swap the Saxon XSLT engine or to wire XQuery 3.1 / XSD 1.1 engines (not bundled), use the Action overload — the DI counterpart of IEngineRouter.RegisterSaxonEngines:

services.AddAltovaGen(options =>
{
    options.SaxonXslt       = mySaxonXsltEngine;    // null ⇒ bundled SaxonCS-HE
    options.SaxonXQuery     = myXQuery31Engine;     // null ⇒ BCL XPath subset
    options.SaxonValidation = myXsd11Engine;        // null ⇒ XSD 1.1 throws
});

Registered services:

Lifetime Services
Singleton (stateless) IEngineRouter → EngineRouter, BclXsltEngine, BclXQueryEngine, BclValidatorEngine, SaxonXsltEngine
Transient (per-operation state) IApplication, IXSLT1, IXSLT2, IXQuery, IXMLValidator

Installation

dotnet add package AltovaGen

Requirements

  • .NET 8.0 or later
  • AnyCPU / platform-agnostic (no x86 dependency)

The original 32-bit Altova.AltovaXML.dll and any Altova installation are not required — neither at build time nor at runtime. AltovaGen has zero COM dependencies and never loads that assembly.

Building and testing

dotnet build AltovaGen.slnx -c Release
dotnet test  AltovaGen.slnx -c Release

License

MIT License — see LICENSE. The bundled SaxonCS-HE engine is Saxonica's Home Edition and is distributed under its own open-source license (MPL-2.0); it is consumed as a NuGet dependency and is not redistributed inside this package, and it requires no license key. Review Saxonica's terms for your distribution model.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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
2.0.3 41 10/6/2026
2.0.2 36 10/6/2026