Asterix specifications
This project uses .xml files for asterix definitions. The .xml files
can be created and maintained by editing the files directly, however a
prefered approach is to convert existing definition files instead.
Basic conversion flow:
(unstructured).pdf → .ast ↔ .json → .xml
This directory contains a script to convert asterix definitions
from .json to .xml format.
Asterix specification formats
-
Original asterix definitions are defined as unstructured (free text)
.pdffiles by eurocontrol. -
A structured version of the specifications is available in
.astand.jsonformats. Custom.astformat uses a low overhead syntax and is used to maintain the specifications. A converter exists, as part of asterix-specs project, to convert between.astand.jsonsyntaxes in both directions transparently. -
.jsonfiles are in turn converted to the target.xmlformat, using a script from this directory.
In case of problems in asterix definitions, users of this project are encouraged to report problems upstream.
Running asterixjson2xml.py script
NOTE:
asterixjson2xml.pyscript requirespython36or higher.
Basic conversion example:
# check python version
python3 --version
# download definition in .json format
curl https://zoranbosnjak.github.io/asterix-specs/specs/cat062/cats/cat1.18/definition.json > input.json
# convert json to xml
python3 asterixjson2xml.py < input.json > output.xml
# or directly
curl https://zoranbosnjak.github.io/asterix-specs/specs/cat062/cats/cat1.18/definition.json | python3 asterixjson2xml.py
Combine CAT+REF definition to a single xml:
python3 asterixjson2xml.py --cat category.json --ref ref.json --outfile out.xml
Running update-specs.py script
This scripts autimatically reads latest Asterix specifications from asterix-specs-out and creates all XML definitions in specs folder.
python3 update-specs.py
Conversion workflow when .json file is available
- download
.jsonfile; - convert
.jsonto.xml; - review generated
.xmlfile; - compare new
.xmlfile with an old one (if exists); - commit new/changed
.xmlfile to this repository;
NOTE: If the resulting
.xmlfile in not as expected, check/modify theasterixjson2xml.pyscript.
NOTE: Do not manually edit converted
.xmlfiles if possible.
Updating asterix specifications
Asterix specifications shall be extended/modified in the upstream asterix-specs project.
Procedure:
- clone asterix-specs project;
- add/modify
.astfile(s); - validate file(s) using a converter;
- the same converter can be used to convert to
.jsonfor local testing; - pretify modified
.astfiles, using a converter. - review changes by peer reviewer, make sure that changes are correct and complete;
- create pull request to make the changes available to others;