Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter Generation Helper Script #43

Closed
nikitawootten-nist opened this issue Jul 11, 2023 · 3 comments · Fixed by #44
Closed

Converter Generation Helper Script #43

nikitawootten-nist opened this issue Jul 11, 2023 · 3 comments · Fixed by #44
Assignees
Milestone

Comments

@nikitawootten-nist
Copy link
Collaborator

nikitawootten-nist commented Jul 11, 2023

Write a single bash script that calls Maven to produce the converter XSLTs from this repository, with minimal change to interfaces or underlying calls. (If it calls Saxon twice, so be it.)

As arguments it accepts a Metaschema module source XML with valid imports; a name part; and a path.

The script writes two converters (XSLTs) to the path named, one in each direction (XML/JSON), with appropriate names constructed from the name part.

Longer term work: refactor this to run under XProc -- goes with #41 and #42. This will involve some XSLT rework as well (to externalize some wrapper logic now only in the XSLT pipeline. The advantages will be (a) more efficient runtime (speed/memory), and (b) easier integration into further pipeline optimizations.

A goal for this Issue is thus to set the ground for that one, producing a follow-on Issue prior to #41.

@nikitawootten-nist nikitawootten-nist changed the title Converter Generation Converter Generation Helper Script Jul 11, 2023
@wendellpiez
Copy link
Collaborator

The XSLT rewrite/shakeout to make converter generators work under XProc -- as well as XSLT -- could (should) also address this bug in the runtime interface: usnistgov/OSCAL#1849

@wendellpiez
Copy link
Collaborator

The script to borrow from is https://github.com/usnistgov/metaschema-xslt/blob/develop/src/schema-gen/mvn-xsd-schema-xsl.sh. As noted above, result file naming should follow the current OSCAL schema naming convention.

@wendellpiez
Copy link
Collaborator

wendellpiez commented Jul 13, 2023

Working here: #44 (see the src/converter-gen folder).

These are ready for testing.

Note that the script that generates the pair of XSLTs must put them in the same place - a shortcoming, for now, to be remedied by the followup work here (the XProc).

Each of the scripts that generates a single converter lets you designate the path and file name where you want it to be produced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants