Versions Compared

Key

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

...

2. Parse XML with a standard python library such as lxml or etree

3. Most likely - implement custom code that loops through the XML parser output and create the AST objects accordingly.
The dacite library requires a hierarchical dictionary in which the keys are named identically to the member variables of the AST.  However, we anticipate that the AST model we want might not be a direct copy of the input XML structure but rather a simplified one (XML might include information we want to not include).  If that is the case, then a custom loop is required to interpret and build up the AST we want is requiredbecause dacite can only convert from dict to @dataclass hierarchy if the names of the fields match exactly.

4. Once that is done, implement a model-to-model translation by mirroring the protobuf_to_ifex.py implementation, which uses the generalized rule_translator.py translation engine.

5. Create output Jinja templates to enable "printout" from the new AST model (for ARXML or other).
The "new" setup (publication pending) now enables printouts from any similar AST model, whereas the old code was tied to only use the IFEX AST model as input.

...