Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The files are described below.

Netex version requirements

Samtrafiken requires submitted NeTEx datasets to comply with the Norwegian NeTEx 1.0.11 standard.

If you are using Java, you can use the netex-java-model package offered by Entur. This package helps validating your NeTEx files against the previously mentioned XSD files, and is the same validation as we use when we receive NeTEx files. https://github.com/entur/netex-java-model/releases/tag/netex-java-model-1.0.11

Code Block
languagexml
<dependency>
    <groupId>org.entur</groupId>
    <artifactId>netex-java-model</artifactId>
    <version>1.0.11</version>
</dependency>

In order to validate a file, you can take a look at this example code:

Code Block
languagejava
NeTExValidator netexValidator = new NeTExValidator();
Schema schema = netexValidator.getSchema();
Validator validator = schema.newValidator();
validator.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
validator.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
validator.setErrorHandler(new XmlErrorHandler());
validator.validate(new StreamSource(netexFile));

If you want to validate the files in another way, you can use XSD files directly. These files can be found here: https://github.com/NeTEx-CEN/NeTEx

Codespace and versioning

  • The id attribute must follow the pattern: [codespace]:[type]:[id] or [countrycode]:[codespace]:[type]:[id] . Examples: 253:Authority:9010005000000000 or SE:253:Authority:9010005000000000.
    Be consistent with your choice throughout all of the files.

  • The version must be a positive whole number (integer) or “any”.

  • The version number must be increased in such a way that the latest version of the object always has the highest number.

  • We recommend using the pattern YYYYMMDDHHmmSS as version if your non-netex objects are already version controlled with "exists from"-dates.

  • The Xmlns value of the Codespace-element is provided by Samtrafiken.

...