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.
-
Original asterix definitions are defined as unstructured (free text)
.pdf
files by eurocontrol. -
A structured version of the specifications is available in
.ast
and.json
formats. Custom.ast
format uses a low overhead syntax and is used to maintain the specifications. A converter exists, as part of asterix-specs project, to convert between.ast
and.json
syntaxes in both directions transparently. -
.json
files are in turn converted to the target.xml
format, using a script from this directory.
In case of problems in asterix definitions, users of this project are encouraged to report problems upstream.
NOTE:
asterixjson2xml.py
script requirespython36
or higher.
# 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
python3 asterixjson2xml.py --cat category.json --ref ref.json --outfile out.xml
This scripts autimatically reads latest Asterix specifications from asterix-specs-out and creates all XML definitions in specs folder.
python3 update-specs.py
- download
.json
file; - convert
.json
to.xml
; - review generated
.xml
file; - compare new
.xml
file with an old one (if exists); - commit new/changed
.xml
file to this repository;
NOTE: If the resulting
.xml
file in not as expected, check/modify theasterixjson2xml.py
script.
NOTE: Do not manually edit converted
.xml
files if possible.
Asterix specifications shall be extended/modified in the upstream asterix-specs project.
Procedure:
- clone asterix-specs project;
- add/modify
.ast
file(s); - validate file(s) using a converter;
- the same converter can be used to convert to
.json
for local testing; - pretify modified
.ast
files, 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;