Skip to content

Building code from NeTEx XSD

Stefan de Konink edited this page Jul 9, 2024 · 3 revisions

work in progress

Java code

https://github.com/entur/netex-java-model

Python code

https://github.com/tefra/xsdata

<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns="http://pypi.org/project/xsdata" version="23.8">
  <Output maxLineLength="320" subscriptableTypes="false" unionType="false">
    <Package>netex</Package>
    <Format repr="true" eq="true" order="false" unsafeHash="false" frozen="false" slots="false" kwOnly="true">dataclasses</Format>
    <Structure>clusters</Structure>
    <DocstringStyle>Blank</DocstringStyle>
    <FilterStrategy>allGlobals</FilterStrategy>
    <RelativeImports>true</RelativeImports>
    <CompoundFields defaultName="choice" useSubstitutionGroups="true" forceDefaultName="false" maxNameParts="10">true</CompoundFields>
    <PostponedAnnotations>false</PostponedAnnotations>
    <UnnestClasses>false</UnnestClasses>
    <IgnorePatterns>false</IgnorePatterns>
    <IncludeHeader>false</IncludeHeader>
  </Output>
  <Conventions>
    <ClassName case="pascalCase" safePrefix="type"/>
    <FieldName case="snakeCase" safePrefix="value"/>
    <ConstantName case="screamingSnakeCase" safePrefix="value"/>
    <ModuleName case="snakeCase" safePrefix="mod"/>
    <PackageName case="snakeCase" safePrefix="pkg"/>
  </Conventions>
  <Substitutions>
    <Substitution type="class" search="fooType" replace="Foo"/>
    <Substitution type="class" search="ABCSomething" replace="ABCSomething"/>
    <Substitution type="field" search="ChangeofGauge" replace="change_of_gauge"/>
    <Substitution type="package" search="http://www.w3.org/1999/xhtml" replace="xtml"/>
    <Substitution type="module" search="2010.1" replace="2020a"/>
  </Substitutions>
  <Extensions/>
</Config>

C# code

https://github.com/mganss/XmlSchemaClassGenerator tested in combination with: https://github.com/NeTEx-CEN/neTEx-light

Clone this wiki locally