From 08f57f63f51e0ad399796f0fc763ee7b6129a967 Mon Sep 17 00:00:00 2001 From: Jason Rebelo Neves Date: Sun, 4 Oct 2026 00:27:29 +0200 Subject: [PATCH] :memo: simplify package and generator documentation --- AGENTS.md | 6 +- README.md | 221 ++++-------------- docs/model-behaviour.md | 64 +++++ .../README.md | 88 +++---- src/netex/Spillgebees.NeTEx.Models/README.md | 73 +++--- src/siri/Spillgebees.SIRI.Models/README.md | 73 +++--- 6 files changed, 221 insertions(+), 304 deletions(-) create mode 100644 docs/model-behaviour.md diff --git a/AGENTS.md b/AGENTS.md index 409579c..6cf7004 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,11 +53,13 @@ src/ Spillgebees.SIRI.Models/ Meta-package (all SIRI versions) Spillgebees.SIRI.Models.V2_1/ SIRI v2.1 bindings Spillgebees.SIRI.Models.V2_2/ SIRI v2.2 bindings + Spillgebees.SIRI.Models.V2_2_1/ SIRI v2.2.1 bindings + Spillgebees.SIRI.Models.V2_3/ SIRI v2.3 bindings Spillgebees.SIRI.Models.Tests/ Tests netex/ NeTEx.Models.targets NuGet metadata + build-time generation Spillgebees.NeTEx.Models/ Meta-package (all NeTEx versions) - Spillgebees.NeTEx.Models.V1_*/ Version-specific bindings (5 versions) + Spillgebees.NeTEx.Models.V*/ Version-specific NeTEx bindings Spillgebees.NeTEx.Models.Tests/ Tests ``` @@ -143,7 +145,7 @@ Test classes are plain `public class` with no base class or constructor injectio ## Tooling -- **SDK**: .NET 10.0 (`global.json` pins `10.0.102`, rolls forward within feature band) +- **SDK**: .NET 10.0 (`global.json` pins `10.0.401`, rolls forward to a later feature band when needed) - **Versioning**: MinVer (automatic from Git tags, no manual versions in csproj) - **Reproducible builds**: `DotNet.ReproducibleBuilds` package - **License**: EUPL-1.2 diff --git a/README.md b/README.md index 40ac121..6a3a9c1 100644 --- a/README.md +++ b/README.md @@ -1,213 +1,78 @@ # Spillgebees.Transmodel -

- GitHub Workflow Status (with branch) - License -

+[![Build & test](https://github.com/Spillgebees/Transmodel/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/Spillgebees/Transmodel/actions/workflows/build-and-test.yml) +[![NeTEx NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?label=NeTEx)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) +[![SIRI NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?label=SIRI)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) +[![License](https://img.shields.io/github/license/Spillgebees/Transmodel)](LICENSE) -Strongly-typed C# XML bindings for [Transmodel](https://transmodel-cen.eu/)-based European public transport standards. Currently, covers [NeTEx](https://github.com/NeTEx-CEN/NeTEx) (Network Timetable Exchange) and [SIRI](https://github.com/SIRI-CEN/SIRI) (Service Interface for Real-time Information), with the flexibility to support additional Transmodel-based standards. +C# XML bindings for [NeTEx](https://github.com/TransmodelEcosystem/NeTEx) timetable data and [SIRI](https://github.com/TransmodelEcosystem/SIRI) real-time transport data, generated from their XSD schemas. The packages target .NET `10.0` and use `XmlSerializer`. -Generated from the official CEN XSD schemas and verified with automated tests. +The project uses AI-assisted development and has not had a full manual review. It is pre-production software. -> **Note:** This project was developed with significant AI assistance. While it is functional and tested, it has not yet undergone a full manual review. Treat it as pre-production. Cntributions and feedback are welcome. +## Install models -## Generator tool - -A CLI tool that downloads XSD schemas from the official CEN repositories and generates modern C# XML bindings with the latest features. Use it to generate bindings for any schema version, including unreleased branches or specific commits. - -| Package | NuGet | -|--------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| `Spillgebees.Transmodel.Generator` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.Transmodel.Generator?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.Transmodel.Generator) | - -```bash -dotnet tool install -g Spillgebees.Transmodel.Generator -``` - -### NeTEx generation +Choose the schema version your data provider uses. For example: ```bash -transmodel-generator generate-netex --version v1.3.1 --output ./Generated --namespace MyApp.NeTEx -``` - -Generates XML bindings with the following sub-namespaces: - -| Sub-namespace | XML Namespace | Description | -|---------------------|----------------------------------|----------------------------------------| -| `MyApp.NeTEx.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | -| `MyApp.NeTEx.SIRI` | `http://www.siri.org.uk/siri` | SIRI types (subset bundled with NeTEx) | -| `MyApp.NeTEx.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | - -### SIRI generation - -```bash -transmodel-generator generate-siri --version v2.2 --output ./Generated --namespace MyApp.SIRI -``` - -Generates XML bindings with the following sub-namespaces: - -| Sub-namespace | XML Namespace | Description | -|---------------------|----------------------------------------|-------------------------------| -| `MyApp.SIRI.SIRI` | `http://www.siri.org.uk/siri` | Core SIRI types | -| `MyApp.SIRI.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | -| `MyApp.SIRI.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | -| `MyApp.SIRI.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | -| `MyApp.SIRI.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | -| `MyApp.SIRI.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | -| `MyApp.SIRI.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | - -### CLI reference - -``` -transmodel-generator generate-netex [options] -transmodel-generator generate-siri [options] - -Options: - -v, --version Schema version tag (default: v1.3.1 for NeTEx, v2.2 for SIRI) - --ref Git ref (branch or commit SHA), mutually exclusive with --version - -o, --output Output directory for generated C# files (default: ./Generated) - -n, --namespace Root C# namespace (default: NeTEx.Models / SIRI.Models) - --clean Delete output directory before generating - --verbose Enable verbose logging - -transmodel-generator list-netex-versions List available NeTEx version tags -transmodel-generator list-siri-versions List available SIRI version tags +dotnet add package Spillgebees.NeTEx.Models.V1_3_1 +dotnet add package Spillgebees.SIRI.Models.V2_2 ``` -## Pre-generated packages - -If you don't need custom generation, install one of the pre-generated packages below. These are built with the same generator, tested, and published to NuGet for every release. +The version in a package name identifies the upstream schema, not the NuGet release. Each schema version has its own C# namespace, so you can reference several versions in one application. The meta-packages include all versions listed below. ### NeTEx -Versions correspond to [tags in the NeTEx-CEN/NeTEx GitHub repository](https://github.com/NeTEx-CEN/NeTEx/tags). +| NeTEx version | Package | NuGet | +| --- | --- | --- | +| `v1.2` | `Spillgebees.NeTEx.Models.V1_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2) | +| `v1.2.2` | `Spillgebees.NeTEx.Models.V1_2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_2) | +| `v1.2.3` | `Spillgebees.NeTEx.Models.V1_2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_3?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_3) | +| `v1.3.0` | `Spillgebees.NeTEx.Models.V1_3_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_0?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_0) | +| `v1.3.1` | `Spillgebees.NeTEx.Models.V1_3_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_1) | +| `v1.3.2` | `Spillgebees.NeTEx.Models.V1_3_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_2) | +| `v2.0.0` | `Spillgebees.NeTEx.Models.V2_0_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V2_0_0?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V2_0_0) | +| All versions | `Spillgebees.NeTEx.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) | -| NeTEx version | Package | NuGet | -|:--------------------------------------------------------:|-----------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| [v1.2](https://github.com/NeTEx-CEN/NeTEx/tree/v1.2) | `Spillgebees.NeTEx.Models.V1_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2) | -| [v1.2.2](https://github.com/NeTEx-CEN/NeTEx/tree/v1.2.2) | `Spillgebees.NeTEx.Models.V1_2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_2) | -| [v1.2.3](https://github.com/NeTEx-CEN/NeTEx/tree/v1.2.3) | `Spillgebees.NeTEx.Models.V1_2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_3?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_3) | -| [v1.3.0](https://github.com/NeTEx-CEN/NeTEx/tree/v1.3.0) | `Spillgebees.NeTEx.Models.V1_3_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_0?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_0) | -| [v1.3.1](https://github.com/NeTEx-CEN/NeTEx/tree/v1.3.1) | `Spillgebees.NeTEx.Models.V1_3_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_1) | -| All versions | `Spillgebees.NeTEx.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) | +See the [NeTEx usage example and namespaces](src/netex/Spillgebees.NeTEx.Models/README.md#serialize-a-publication). -```bash -dotnet add package Spillgebees.NeTEx.Models.V1_3_1 -``` +### SIRI -Each NeTEx version package contains three sub-namespaces: - -| Sub-namespace | XML Namespace | Description | -|---------------|----------------------------------|----------------------------------------| -| `.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | -| `.SIRI` | `http://www.siri.org.uk/siri` | SIRI types (subset bundled with NeTEx) | -| `.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | - -```csharp -using System.Text; -using System.Xml; -using System.Xml.Serialization; -using Spillgebees.NeTEx.Models.V1_3_1.NeTEx; - -var delivery = new PublicationDeliveryStructure -{ - PublicationTimestamp = DateTimeOffset.UtcNow, - ParticipantRef = "my-data-provider", - Description = new MultilingualString { Value = "Stop places export" }, -}; - -var serializer = new XmlSerializer(typeof(PublicationDeliveryStructure)); -using var stream = new MemoryStream(); -using var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings -{ - Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), - Indent = true, -}); -serializer.Serialize(xmlWriter, delivery); - -// -// -// 2026-02-13T12:00:00+00:00 -// my-data-provider -// Stop places export -// -``` +| SIRI version | Package | NuGet | +| --- | --- | --- | +| `v2.1` | `Spillgebees.SIRI.Models.V2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_1) | +| `v2.2` | `Spillgebees.SIRI.Models.V2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2) | +| `v2.2.1` | `Spillgebees.SIRI.Models.V2_2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2_1) | +| `v2.3` | `Spillgebees.SIRI.Models.V2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_3?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_3) | +| All versions | `Spillgebees.SIRI.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) | -### SIRI +See the [SIRI usage example and namespaces](src/siri/Spillgebees.SIRI.Models/README.md#serialize-a-service-delivery). + +Read [generated model behaviour](docs/model-behaviour.md) for choice diagnostics, default values, and fixed values. -Versions correspond to [tags in the SIRI-CEN/SIRI GitHub repository](https://github.com/SIRI-CEN/SIRI/tags). +## Generate your own models -| SIRI version | Package | NuGet | -|:--------------------------------------------------:|--------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------:| -| [v2.1](https://github.com/SIRI-CEN/SIRI/tree/v2.1) | `Spillgebees.SIRI.Models.V2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_1) | -| [v2.2](https://github.com/SIRI-CEN/SIRI/tree/v2.2) | `Spillgebees.SIRI.Models.V2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2) | -| All versions | `Spillgebees.SIRI.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) | +Use the generator for a custom namespace or an upstream tag, branch, or commit that has no model package. ```bash -dotnet add package Spillgebees.SIRI.Models.V2_2 +dotnet tool install -g Spillgebees.Transmodel.Generator +transmodel-generator generate-siri --version v2.2 --output ./Generated --namespace MyApp.SIRI ``` -Each SIRI version package contains seven sub-namespaces: - -| Sub-namespace | XML Namespace | Description | -|---------------|----------------------------------------|-------------------------------| -| `.SIRI` | `http://www.siri.org.uk/siri` | SIRI types | -| `.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | -| `.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | -| `.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | -| `.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | -| `.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | -| `.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | - -```csharp -using System.Text; -using System.Xml; -using System.Xml.Serialization; -using Spillgebees.SIRI.Models.V2_2.SIRI; - -var siri = new Siri -{ - ServiceDelivery = new ServiceDelivery - { - ResponseTimestamp = DateTimeOffset.UtcNow, - }, -}; - -var serializer = new XmlSerializer(typeof(Siri)); -using var stream = new MemoryStream(); -using var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings -{ - Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), - Indent = true, -}); -serializer.Serialize(xmlWriter, siri); - -// -// -// -// 2026-02-13T12:00:00+00:00 -// -// -``` +The [generator README](src/generator/Spillgebees.Transmodel.Generator/README.md) covers both standards, command options, and schema caching. -## Building from source +## Build from source -The generated bindings are **not committed** to the repository, they are generated at build time. To build locally: +Use the .NET SDK selected by `global.json`. From the repository root, run: ```bash dotnet build Spillgebees.Transmodel.slnx --configuration Release dotnet test --solution Spillgebees.Transmodel.slnx --configuration Release ``` -The build downloads the XSD schemas from GitHub, generates the XML bindings, and compiles them. Downloaded schemas are cached in local app data so subsequent builds don't require network access. - -Use `dotnet clean` to remove the generated files and trigger a fresh generation on the next build. +The first build downloads schemas from GitHub and generates the model classes. Later builds reuse the schema cache. Generated files are ignored by Git. -## Supported frameworks - -- .NET 10.0 +To regenerate the models, run `dotnet clean Spillgebees.Transmodel.slnx`, then build again. Fix generation problems in the generator or its `XmlSchemaClassGenerator` fork, since the next generation replaces files under `Generated/`. ## License -This project is licensed under the [European Union Public Licence v. 1.2 (EUPL-1.2)](LICENSE). - -The NeTEx schemas are licensed under [GPL-3.0](https://github.com/NeTEx-CEN/NeTEx/blob/master/LICENSE) by CEN. EUPL-1.2 is [compatible](https://joinup.ec.europa.eu/collection/eupl/matrix-eupl-compatible-open-source-licences) with GPL-3.0 per its compatibility clause. The SIRI schemas are published by CEN on the [SIRI-CEN/SIRI](https://github.com/SIRI-CEN/SIRI) repository without an explicit open-source license. +This project uses [EUPL-1.2](LICENSE). The upstream schemas have their own licensing information in the [NeTEx repository](https://github.com/TransmodelEcosystem/NeTEx) and [SIRI repository](https://github.com/TransmodelEcosystem/SIRI). diff --git a/docs/model-behaviour.md b/docs/model-behaviour.md new file mode 100644 index 0000000..8e40399 --- /dev/null +++ b/docs/model-behaviour.md @@ -0,0 +1,64 @@ +# Generated model behaviour + +The models use `XmlSerializer`. The bundled analyzer checks XML choice groups when you compile consumer code. It does not run when you serialize an object. + +## Construct choice groups + +Select an alternative for each required choice group in the object initializer. You can omit optional properties and assign them later. + +`XCGA001` reports assignments to conflicting alternatives. `XCGA002` reports a missing required alternative and lists the properties you can choose. A sequence inside a choice can require several properties from the same alternative. + +For example, SIRI coordinates use the same choice alternative for longitude and latitude: + +```csharp +using Spillgebees.SIRI.Models.V2_2.SIRI; + +var location = new LocationStructure +{ + Longitude = 6, + Latitude = 49, +}; +``` + +The analyzer checks exclusivity at each assignment. To switch between nullable reference alternatives, clear the old property before assigning the new one. A nillable property can serialize `null` as `xsi:nil`, so setting it to `null` does not necessarily remove that alternative from XML. + +If your construction pattern must fill required choices after the initializer, suppress `XCGA002` at that location. Suppression accepts responsibility for completing the object before serialization. + +## Preserve default-value presence + +An untouched optional scalar property returns its XSD default but stays out of XML. Assigning a value marks it as present, even when that value equals the default. + +```csharp +var journey = new MonitoredVehicleJourneyStructure(); +journey.Monitored = true; +``` + +The tracking state is private. There is no public `MonitoredSpecified` property. Deserialization preserves presence through the setter. Copying property values into another object counts as explicit assignment. + +Object-valued defaults retain their existing serialization behaviour. For example, NeTEx `Note` serializes its default object even when the `Note` setter was not called. This preserves edits through `Note.Value` or `Note.Lang`, which scalar assignment tracking cannot observe. + +This getter behaviour is a model convenience. In XSD, an absent defaulted element and an empty defaulted element have different meanings. The [XML Schema primer](https://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints) explains element and attribute defaults. + +## Include fixed values + +Fixed-value properties are getter-only. Required fixed elements and attributes serialize automatically. + +For optional fixed elements, call the generated inclusion method: + +```csharp +var filtering = new SituationExchangeServiceCapabilitiesStructureTopicFiltering +{ + DefaultPreviewInterval = TimeSpan.FromHours(1), +}; +filtering.IncludeFilterByLocationRef(); +``` + +The serializer uses a separate public property hidden from IntelliSense. That property accepts the fixed value and rejects other values when reading XML. Application code should use the getter and inclusion method. + +XML token lists also use hidden serialization properties. For example, SIRI `v2.3` exposes `Keywords` as `List` and writes it as one whitespace-separated XML element. + +## Validate XML at the boundary + +The analyzer checks selected construction patterns. It cannot prove that every object produces schema-valid XML. Empty collections, mutations through helpers, and relationships between separate conditional branches can exceed its analysis. + +Repeated choices allow different alternatives on separate repetitions. Some more complex repeated sequences cannot preserve their original interleaving in separate generated collections. Validate the XML against the applicable upstream XSD when that distinction matters to your exchange. diff --git a/src/generator/Spillgebees.Transmodel.Generator/README.md b/src/generator/Spillgebees.Transmodel.Generator/README.md index 677d250..b94c880 100644 --- a/src/generator/Spillgebees.Transmodel.Generator/README.md +++ b/src/generator/Spillgebees.Transmodel.Generator/README.md @@ -1,10 +1,10 @@ # Spillgebees.Transmodel.Generator -CLI tool for generating C# XML bindings from [NeTEx](https://github.com/NeTEx-CEN/NeTEx) (Network Timetable Exchange) and [SIRI](https://github.com/SIRI-CEN/SIRI) (Service Interface for Real-time Information) XSD schemas. +Generate C# XML bindings from [NeTEx](https://github.com/TransmodelEcosystem/NeTEx) and [SIRI](https://github.com/TransmodelEcosystem/SIRI) XSD schemas. Requires .NET `10.0`. -Downloads schemas from the official repositories and generates modern C# XML bindings. Downloaded schemas are cached locally so repeated runs don't hit GitHub. +The tool downloads schemas from the upstream repositories. Use a release tag, branch, or commit SHA to select the schemas. -## Getting started +## Install Install the tool globally: @@ -12,51 +12,47 @@ Install the tool globally: dotnet tool install -g Spillgebees.Transmodel.Generator ``` -### NeTEx generation +## Generate NeTEx models Generate bindings for a specific NeTEx version tag: ```bash -transmodel-generator generate-netex --version v1.3.1 --output ./Generated --namespace MyApp.NeTEx +transmodel-generator generate-netex --version v2.0.0 --output ./Generated --namespace MyApp.NeTEx ``` -This downloads the NeTEx schemas and generates XML bindings with the following sub-namespaces: +The root namespace gets these suffixes: -| Sub-namespace | XML Namespace | Description | -|----------------------|----------------------------------|----------------------------------------| -| `MyApp.NeTEx.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | -| `MyApp.NeTEx.SIRI` | `http://www.siri.org.uk/siri` | SIRI types (subset bundled with NeTEx) | -| `MyApp.NeTEx.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | +| Sub-namespace | XML namespace | Description | +| --- | --- | --- | +| `MyApp.NeTEx.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | +| `MyApp.NeTEx.SIRI` | `http://www.siri.org.uk/siri` | SIRI types bundled with NeTEx | +| `MyApp.NeTEx.GML` | `http://www.opengis.net/gml/3.2` | Geographic markup types | -### SIRI generation +## Generate SIRI models Generate bindings for a specific SIRI version tag: ```bash -transmodel-generator generate-siri --version v2.2 --output ./Generated --namespace MyApp.SIRI +transmodel-generator generate-siri --version v2.3 --output ./Generated --namespace MyApp.SIRI ``` -This downloads the SIRI schemas and generates XML bindings with the following sub-namespaces: +The root namespace gets these suffixes: -| Sub-namespace | XML Namespace | Description | -|----------------------|----------------------------------------|-------------------------------| -| `MyApp.SIRI.SIRI` | `http://www.siri.org.uk/siri` | Core SIRI types | -| `MyApp.SIRI.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | -| `MyApp.SIRI.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | -| `MyApp.SIRI.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | -| `MyApp.SIRI.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | -| `MyApp.SIRI.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | -| `MyApp.SIRI.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | +| Sub-namespace | XML namespace | Description | +| --- | --- | --- | +| `MyApp.SIRI.SIRI` | `http://www.siri.org.uk/siri` | Core SIRI types | +| `MyApp.SIRI.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | +| `MyApp.SIRI.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | +| `MyApp.SIRI.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | +| `MyApp.SIRI.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | +| `MyApp.SIRI.GML` | `http://www.opengis.net/gml/3.2` | Geographic markup types | +| `MyApp.SIRI.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | ## Schema caching -Schemas are cached locally after the first download. Version tags and commit SHAs are immutable, so they are cached permanently. Branch refs are always re-downloaded. +The tool reuses cached schemas for version tags and commit SHAs. Branch refs download on every run. To refresh a cached tag, delete its directory from the schema cache before running the command again. -The cache is stored in local app data: - -- **Linux**: `~/.local/share/{netex,siri}-schemas/` -- **macOS**: `~/Library/Application Support/{netex,siri}-schemas/` -- **Windows**: `%LOCALAPPDATA%\{netex,siri}-schemas\` +The cache uses the `netex-schemas` and `siri-schemas` directories under .NET's `Environment.SpecialFolder.LocalApplicationData`. On Linux, this is usually `~/.local/share`. On Windows, it is `%LOCALAPPDATA%`. ## CLI reference @@ -65,41 +61,31 @@ transmodel-generator generate-netex [options] transmodel-generator generate-siri [options] Options: - -v, --version Schema version tag (default: v1.3.1 for NeTEx, v2.2 for SIRI) + -v, --version Schema version tag (default: v2.0.0 for NeTEx, v2.3 for SIRI) --ref Git ref (branch or commit SHA), mutually exclusive with --version -o, --output Output directory for generated C# files (default: ./Generated) -n, --namespace Root C# namespace (default: NeTEx.Models / SIRI.Models) - --clean Delete output directory before generating - --verbose Enable verbose logging + --clean Delete output directory before generating + --verbose Enable verbose logging transmodel-generator list-netex-versions List available NeTEx version tags transmodel-generator list-siri-versions List available SIRI version tags ``` -## Pre-generated models +## Use a branch or commit -If you don't need custom generation, use the pre-generated packages instead: +Pass `--ref` instead of `--version`. For example, replace `COMMIT_SHA` with an upstream commit: -### NeTEx +```bash +transmodel-generator generate-siri --ref COMMIT_SHA --output ./Generated --namespace MyApp.SIRI +``` -| NeTEx version | Package | NuGet | -|:-------------:|-----------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| v1.2 | `Spillgebees.NeTEx.Models.V1_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2) | -| v1.2.2 | `Spillgebees.NeTEx.Models.V1_2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_2) | -| v1.2.3 | `Spillgebees.NeTEx.Models.V1_2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_3?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_3) | -| v1.3.0 | `Spillgebees.NeTEx.Models.V1_3_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_0?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_0) | -| v1.3.1 | `Spillgebees.NeTEx.Models.V1_3_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_1) | -| v2.0.0 | `Spillgebees.NeTEx.Models.V2_0_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V2_0_0?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V2_0_0) | -| All versions | `Spillgebees.NeTEx.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) | +`--clean` deletes the entire output directory before generation. Keep handwritten code outside that directory. -### SIRI +## Pre-generated models -| SIRI version | Package | NuGet | -|:------------:|----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| v2.1 | `Spillgebees.SIRI.Models.V2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_1) | -| v2.2 | `Spillgebees.SIRI.Models.V2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2) | -| All versions | `Spillgebees.SIRI.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) | +For the supported schema versions and usage examples, see the [NeTEx packages](https://github.com/Spillgebees/Transmodel/blob/main/src/netex/Spillgebees.NeTEx.Models/README.md) and [SIRI packages](https://github.com/Spillgebees/Transmodel/blob/main/src/siri/Spillgebees.SIRI.Models/README.md). ## License -[EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12). The NeTEx schemas are licensed under [GPL-3.0](https://github.com/NeTEx-CEN/NeTEx/blob/master/LICENSE) by CEN. The SIRI schemas are published by CEN on the [SIRI-CEN/SIRI](https://github.com/SIRI-CEN/SIRI) repository without an explicit open-source license. +[EUPL-1.2](https://github.com/Spillgebees/Transmodel/blob/main/LICENSE). The upstream schemas have their own licensing information in the [NeTEx repository](https://github.com/TransmodelEcosystem/NeTEx) and [SIRI repository](https://github.com/TransmodelEcosystem/SIRI). diff --git a/src/netex/Spillgebees.NeTEx.Models/README.md b/src/netex/Spillgebees.NeTEx.Models/README.md index fef368d..7123dd6 100644 --- a/src/netex/Spillgebees.NeTEx.Models/README.md +++ b/src/netex/Spillgebees.NeTEx.Models/README.md @@ -1,40 +1,35 @@ # Spillgebees.NeTEx.Models -Pre-generated C# XML bindings for [NeTEx](https://github.com/NeTEx-CEN/NeTEx) (Network Timetable Exchange) XSD schemas. +C# XML bindings for [NeTEx](https://github.com/TransmodelEcosystem/NeTEx), generated from the upstream XSD schemas. Requires .NET `10.0`. -Each version package provides strongly-typed classes for a specific [NeTEx-CEN/NeTEx release tag](https://github.com/NeTEx-CEN/NeTEx/tags). Install only the version you need, or use the meta-package to get all versions at once. +## Install -## Available versions - -| NeTEx version | Package | NuGet | -|:-------------:|-----------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| v1.2 | `Spillgebees.NeTEx.Models.V1_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2) | -| v1.2.2 | `Spillgebees.NeTEx.Models.V1_2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_2) | -| v1.2.3 | `Spillgebees.NeTEx.Models.V1_2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_3?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_3) | -| v1.3.0 | `Spillgebees.NeTEx.Models.V1_3_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_0?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_0) | -| v1.3.1 | `Spillgebees.NeTEx.Models.V1_3_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_1) | -| v2.0.0 | `Spillgebees.NeTEx.Models.V2_0_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V2_0_0?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V2_0_0) | -| All versions | `Spillgebees.NeTEx.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) | - -## Getting started +Choose the schema version your data provider uses: ```bash -# Install a single version dotnet add package Spillgebees.NeTEx.Models.V1_3_1 - -# Or install all versions at once -dotnet add package Spillgebees.NeTEx.Models ``` -## Usage +To reference all supported versions, install `Spillgebees.NeTEx.Models` instead. Each version has a separate C# namespace. + +## Available versions + +The version in each package name identifies the schema, not the NuGet release. -Each version package contains three sub-namespaces: +| NeTEx version | Package | NuGet | +| --- | --- | --- | +| `v1.2` | `Spillgebees.NeTEx.Models.V1_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2) | +| `v1.2.2` | `Spillgebees.NeTEx.Models.V1_2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_2) | +| `v1.2.3` | `Spillgebees.NeTEx.Models.V1_2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_2_3?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_2_3) | +| `v1.3.0` | `Spillgebees.NeTEx.Models.V1_3_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_0?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_0) | +| `v1.3.1` | `Spillgebees.NeTEx.Models.V1_3_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_1) | +| `v1.3.2` | `Spillgebees.NeTEx.Models.V1_3_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V1_3_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V1_3_2) | +| `v2.0.0` | `Spillgebees.NeTEx.Models.V2_0_0` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models.V2_0_0?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models.V2_0_0) | +| All versions | `Spillgebees.NeTEx.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.NeTEx.Models?label=nuget)](https://www.nuget.org/packages/Spillgebees.NeTEx.Models) | -| Sub-namespace | XML Namespace | Description | -|---------------|----------------------------------|----------------------------------------| -| `.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | -| `.SIRI` | `http://www.siri.org.uk/siri` | SIRI types (subset bundled with NeTEx) | -| `.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | +## Serialize a publication + +This example writes the delivery header to a UTF-8 XML file. Add the payload required by your data provider before sending it. ```csharp using System.Text; @@ -46,30 +41,34 @@ var delivery = new PublicationDeliveryStructure { PublicationTimestamp = DateTimeOffset.UtcNow, ParticipantRef = "my-data-provider", - Description = new MultilingualString { Value = "Stop places export" }, }; var serializer = new XmlSerializer(typeof(PublicationDeliveryStructure)); -using var stream = new MemoryStream(); +using var stream = File.Create("publication.xml"); using var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings { Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), Indent = true, }); serializer.Serialize(xmlWriter, delivery); - -// -// -// 2026-02-13T12:00:00+00:00 -// my-data-provider -// Stop places export -// ``` +## Namespaces + +The package name is the root namespace. For example, `Spillgebees.NeTEx.Models.V1_3_1.NeTEx` contains the `PublicationDeliveryStructure` type used above. + +| Sub-namespace | XML namespace | Description | +| --- | --- | --- | +| `.NeTEx` | `http://www.netex.org.uk/netex` | NeTEx types | +| `.SIRI` | `http://www.siri.org.uk/siri` | SIRI types bundled with NeTEx | +| `.GML` | `http://www.opengis.net/gml/3.2` | Geographic markup types | + +See [generated model behaviour](https://github.com/Spillgebees/Transmodel/blob/main/docs/model-behaviour.md) for choice diagnostics, default-value presence, and fixed values. + ## Custom generation -If you need full control over namespaces or want to target a different NeTEx version, use the [`Spillgebees.Transmodel.Generator`](https://www.nuget.org/packages/Spillgebees.Transmodel.Generator) CLI tool to generate models from the XSD schemas directly. +Use [`Spillgebees.Transmodel.Generator`](https://github.com/Spillgebees/Transmodel/blob/main/src/generator/Spillgebees.Transmodel.Generator/README.md) for a custom namespace or a different schema tag, branch, or commit. ## License -[EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12). The NeTEx schemas are licensed under [GPL-3.0](https://github.com/NeTEx-CEN/NeTEx/blob/master/LICENSE) by CEN. +[EUPL-1.2](https://github.com/Spillgebees/Transmodel/blob/main/LICENSE). See the [NeTEx repository](https://github.com/TransmodelEcosystem/NeTEx) for upstream schema licensing information. diff --git a/src/siri/Spillgebees.SIRI.Models/README.md b/src/siri/Spillgebees.SIRI.Models/README.md index b3d37ac..531e31c 100644 --- a/src/siri/Spillgebees.SIRI.Models/README.md +++ b/src/siri/Spillgebees.SIRI.Models/README.md @@ -1,40 +1,32 @@ # Spillgebees.SIRI.Models -Pre-generated C# XML bindings for [SIRI](https://github.com/SIRI-CEN/SIRI) (Service Interface for Real-time Information) XSD schemas. +C# XML bindings for [SIRI](https://github.com/TransmodelEcosystem/SIRI), generated from the upstream XSD schemas. Requires .NET `10.0`. -Each version package provides strongly-typed classes for a specific [SIRI-CEN/SIRI release tag](https://github.com/SIRI-CEN/SIRI/tags). Install only the version you need, or use the meta-package to get all versions at once. +## Install -## Available versions - -| SIRI version | Package | NuGet | -|:------------:|----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| v2.1 | `Spillgebees.SIRI.Models.V2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_1?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_1) | -| v2.2 | `Spillgebees.SIRI.Models.V2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2) | -| All versions | `Spillgebees.SIRI.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?logo=nuget&label=)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) | - -## Getting started +Choose the schema version your data provider uses: ```bash -# Install a single version dotnet add package Spillgebees.SIRI.Models.V2_2 - -# Or install all versions at once -dotnet add package Spillgebees.SIRI.Models ``` -## Usage +To reference all supported versions, install `Spillgebees.SIRI.Models` instead. Each version has a separate C# namespace. + +## Available versions + +The version in each package name identifies the schema, not the NuGet release. -Each version package contains seven sub-namespaces: +| SIRI version | Package | NuGet | +| --- | --- | --- | +| `v2.1` | `Spillgebees.SIRI.Models.V2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_1) | +| `v2.2` | `Spillgebees.SIRI.Models.V2_2` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2) | +| `v2.2.1` | `Spillgebees.SIRI.Models.V2_2_1` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_2_1?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_2_1) | +| `v2.3` | `Spillgebees.SIRI.Models.V2_3` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models.V2_3?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models.V2_3) | +| All versions | `Spillgebees.SIRI.Models` | [![NuGet](https://img.shields.io/nuget/vpre/Spillgebees.SIRI.Models?label=nuget)](https://www.nuget.org/packages/Spillgebees.SIRI.Models) | -| Sub-namespace | XML Namespace | Description | -|---------------|----------------------------------------|-------------------------------| -| `.SIRI` | `http://www.siri.org.uk/siri` | Core SIRI types | -| `.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | -| `.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | -| `.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | -| `.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | -| `.GML` | `http://www.opengis.net/gml/3.2` | GML types (geographic markup) | -| `.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | +## Serialize a service delivery + +This example writes the delivery header to a UTF-8 XML file. Add the payload required by your data provider before sending it. ```csharp using System.Text; @@ -51,26 +43,35 @@ var siri = new Siri }; var serializer = new XmlSerializer(typeof(Siri)); -using var stream = new MemoryStream(); +using var stream = File.Create("siri.xml"); using var xmlWriter = XmlWriter.Create(stream, new XmlWriterSettings { Encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), Indent = true, }); serializer.Serialize(xmlWriter, siri); - -// -// -// -// 2026-02-13T12:00:00+00:00 -// -// ``` +## Namespaces + +The package name is the root namespace. For example, `Spillgebees.SIRI.Models.V2_2.SIRI` contains the `Siri` type used above. + +| Sub-namespace | XML namespace | Description | +| --- | --- | --- | +| `.SIRI` | `http://www.siri.org.uk/siri` | Core SIRI types | +| `.IFOPT` | `http://www.ifopt.org.uk/ifopt` | IFOPT types | +| `.ACSB` | `http://www.ifopt.org.uk/acsb` | Accessibility types | +| `.DATEX2` | `http://datex2.eu/schema/2_0RC1/2_0` | DATEX2 types | +| `.WSDL` | `http://wsdl.siri.org.uk` | WSDL/SOAP types | +| `.GML` | `http://www.opengis.net/gml/3.2` | Geographic markup types | +| `.W3` | `http://www.w3.org/XML/1998/namespace` | W3 types | + +See [generated model behaviour](https://github.com/Spillgebees/Transmodel/blob/main/docs/model-behaviour.md) for choice diagnostics, default-value presence, and fixed values. + ## Custom generation -If you need full control over namespaces or want to target a different SIRI version, use the [`Spillgebees.Transmodel.Generator`](https://www.nuget.org/packages/Spillgebees.Transmodel.Generator) CLI tool to generate models from the XSD schemas directly. +Use [`Spillgebees.Transmodel.Generator`](https://github.com/Spillgebees/Transmodel/blob/main/src/generator/Spillgebees.Transmodel.Generator/README.md) for a custom namespace or a different schema tag, branch, or commit. ## License -[EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12). The SIRI schemas are published by CEN on the [SIRI-CEN/SIRI](https://github.com/SIRI-CEN/SIRI) repository without an explicit open-source license. +[EUPL-1.2](https://github.com/Spillgebees/Transmodel/blob/main/LICENSE). See the [SIRI repository](https://github.com/TransmodelEcosystem/SIRI) for upstream schema licensing information.