-
Notifications
You must be signed in to change notification settings - Fork 0
Software & tools
It is possible to create C# classes in different ways.
There are many tools out there, but for instance, you could use the Microsoft xsd.exe
tool or the mganss/XMLSchemaClassGenerator
tool available on Github at https://github.com/mganss/XmlSchemaClassGenerator.
Currently there are some issues if you try to use the official NeTEx XSD as a starting point with either of these tools.
However, the above-mentioned tools work fine if you use them together with an adapted set of XSD-files available from Data4PT. The file set is designed to be compatible with the official NeTEx XSD and to cover many important use cases. It does however not cover all use cases possible with the official schema. There is an interactive graphical presentation of the adapted and reduced XSD available at https://data4pt.org/NeTEx/GraphicKit/Documention_of_reduced_XSD.html.
If you wish to try out this reduced XSD, you can download it at https://data4pt.org/NeTEx/GraphicKit/XSD_reduced.zip.
- Get the zipped XSD.
- Extract the ZIP to a folder.
- Make sure that you have a recent version of the
xsd.exe
. It is part of the .NET Framework Developer Pack and can be downloaded from https://dotnet.microsoft.com/download/dotnet-framework. - Install the developer pack. The
xsd.exe
will be placed in a folder with a path similar toC:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools
. - Open a command prompt in the same folder as where the
NeTEx_publication_reduced-NoConstraint.xsd
resides. - Execute the following command (you may have to adapt the path to
xsd.exe
):
- Get the zipped XSD.
- Extract the ZIP to a folder.
- Download and extract the binary from https://github.com/mganss/XmlSchemaClassGenerator/releases to a separate folder, e.g.,
C:\MGANSS
. - Open a command prompt in the same folder as where the
NeTEx_publication_reduced-NoConstraint.xsd
resides. - Execute the following command (you may have to adapt the path to the exe):
C:\MGANSS\XmlSchemaClassGenerator.Console.exe NeTEx_publication_reduced-NoConstraint.xsd -n http://www.opengis.net/gml/3.2=gml-v
When working with NeTEx data in Java, you can generate Java classes from NeTEx XSD using various tools and libraries. This section will introduce you to the tools and libraries available for Java development with NeTEx.
- Description: The netex-java-model is a Java library that provides NeTEx XML bindings for Java, including additional support for mapping temporal types to native Java objects.
- GitHub Repository: netex-java-model on GitHub
- Description: The netex-parser-java is a Java library designed for parsing NeTEx files and providing the ability to lookup entities within an index.
- GitHub Repository: netex-parser-java on GitHub
Please refer to the respective GitHub repositories for detailed documentation, usage examples, and installation instructions for these Java libraries.