From 040cba2ad1fd0b4a22c542f80bb6551fd4cbd483 Mon Sep 17 00:00:00 2001 From: David Waltermire Date: Fri, 18 Mar 2022 13:29:26 -0400 Subject: [PATCH] Upgrade Saxon use to 10.6 (#1187) * Updates for Saxon 10.6 * updating to latest metaschema toolchain --- .github/workflows/metaschema-artifacts.yml | 2 +- .github/workflows/package-release.yml | 2 +- .github/workflows/website-artifacts.yml | 2 +- build/README.md | 2 +- build/ci-cd/README.md | 4 ++-- build/ci-cd/python/readme.md | 4 ++-- build/ci-cd/setup-ubuntu.sh | 2 +- build/docker-compose.yml | 6 +----- docs/README.md | 4 ++-- json/README.md | 11 ++++++----- xml/README.md | 11 ++++++----- 11 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/metaschema-artifacts.yml b/.github/workflows/metaschema-artifacts.yml index 83c1b9f78f..bcd11d8743 100644 --- a/.github/workflows/metaschema-artifacts.yml +++ b/.github/workflows/metaschema-artifacts.yml @@ -20,7 +20,7 @@ env: HOME_REPO: usnistgov/OSCAL HOME_BRANCH: main # dependency versions - SAXON_VERSION: 9.9.1-3 + SAXON_VERSION: 10.6 # build-specific environment SCHEMATRON_HOME: git-content/schematron OSCAL_HOME: git-content/oscal diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index c3b32d4224..eca99e159a 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -7,7 +7,7 @@ env: # the name of the repo HOME_REPO: usnistgov/OSCAL # dependency versions - SAXON_VERSION: 9.9.1-3 + SAXON_VERSION: 10.6 HUGO_VERSION: 0.69.2 # build-specific environment CONTENT_CONFIG_PATH: src/config diff --git a/.github/workflows/website-artifacts.yml b/.github/workflows/website-artifacts.yml index 35453aaaa7..83554fa23e 100644 --- a/.github/workflows/website-artifacts.yml +++ b/.github/workflows/website-artifacts.yml @@ -33,7 +33,7 @@ env: HOME_REPO: usnistgov/OSCAL HOME_BRANCH: main # dependency versions - SAXON_VERSION: 9.9.0-1 + SAXON_VERSION: 10.6 HUGO_VERSION: 0.83.1 CALABASH_VERSION: 1.2.5-100 # build-specific environment diff --git a/build/README.md b/build/README.md index e7a180e557..82b88df444 100644 --- a/build/README.md +++ b/build/README.md @@ -64,7 +64,7 @@ The following steps are known to work on [Ubuntu](https://ubuntu.com/) (tested i The following is an example of how to configure the environment. ```bash - export SAXON_VERSION="9.9.1-3" + export SAXON_VERSION="10.6" export HUGO_VERSION="0.83.1" export CALABASH_VERSION="1.2.5-100" export CALABASH_HOME="$HOME/calabash" diff --git a/build/ci-cd/README.md b/build/ci-cd/README.md index 933ae5057a..28f8393174 100644 --- a/build/ci-cd/README.md +++ b/build/ci-cd/README.md @@ -91,7 +91,7 @@ The Saxon jar file needs to be retrieved. This can be two ways: For example: ```bash - export SAXON_VERSION=9.9.1-3 + export SAXON_VERSION=10.6 ``` 2. You can manually download any variant of Saxon (e.g., HE, ) from [Saxonica](https://www.saxonica.com/download/java.xml) and set the ```SAXON_HOME``` environment variable to the location of the Saxon JAR. @@ -180,7 +180,7 @@ sudo apt install maven Then run Maven to acquire Saxon: ```bash -export SAXON_VERSION=9.9.1-3 +export SAXON_VERSION=10.6 mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=$SAXON_VERSION ``` diff --git a/build/ci-cd/python/readme.md b/build/ci-cd/python/readme.md index a1d8d39fa4..fdb9602d07 100644 --- a/build/ci-cd/python/readme.md +++ b/build/ci-cd/python/readme.md @@ -7,7 +7,7 @@ This code provides test coverage to validate the OSCAL artifacts as new document 1. [Python 2.7.10 or greater](https://www.python.org/) 2. [xmllint](http://xmlsoft.org/xmllint.html) 3. Java 8.0 or greater -4. [Saxon 9 HE](http://saxon.sourceforge.net/) +4. [Saxon 10 HE](http://saxon.sourceforge.net/) ### Instructions @@ -36,7 +36,7 @@ The command line will provide more detailed error messaging for troubleshooting Reading JSON files is done via simplejson (pip install simplejson). This library reads the JSON files and passes to JSON schema above. -To cover transformations, the testing relies on the Saxon 9 HE open source library. This can be command line driven with Java to perform transformations. This library will be used to do round trip transformations to create temporary files that can be validated by additional Python scripts to provide full test coverage. +To cover transformations, the testing relies on the Saxon HE open source library. This can be command line driven with Java to perform transformations. This library will be used to do round trip transformations to create temporary files that can be validated by additional Python scripts to provide full test coverage. ### Future State Work diff --git a/build/ci-cd/setup-ubuntu.sh b/build/ci-cd/setup-ubuntu.sh index 1ba83677f3..20552e1096 100644 --- a/build/ci-cd/setup-ubuntu.sh +++ b/build/ci-cd/setup-ubuntu.sh @@ -11,7 +11,7 @@ sudo npm install -g ajv-cli prettyjson pip install --user lxml -export SAXON_VERSION=9.9.1-3 +export SAXON_VERSION=10.6 export GITHUB_DIR="$HOME/github" export SCHEMATRON_HOME="$GITHUB_DIR/Schematron/schematron" export OSCAL_TOOLS_DIR="$GITHUB_DIR/usnistgov/oscal-tools" diff --git a/build/docker-compose.yml b/build/docker-compose.yml index feab12a357..6844640ec9 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -7,14 +7,10 @@ services: context: . target: cli args: - saxonversion: 9.9.1-3 + saxonversion: 10.6 hugoversion: 0.83.1 calabashversion: 1.2.5-100 volumes: - "../:/oscal" ports: - "1313:1313" -# environment: -# - SAXON_VERSION=9.9.1-3 -# - JSON_CLI_VERSION=0.0.1-SNAPSHOT -# - CALABASH_VERSION=1.2.5-100 diff --git a/docs/README.md b/docs/README.md index 782b25e83e..51eababe8b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,13 +8,13 @@ The website is built using the [Hugo](https://gohugo.io/) static site generator If using Docker: -- [Saxon-HE for Java](http://saxon.sourceforge.net/#F9.9HE) +- [Saxon-HE for Java](http://saxon.sourceforge.net/) - [Docker 20.10+](https://docs.docker.com/install/) If not using Docker: - macOS, Linux or Windows Subsystem for Linux (WSL) (model doc build scripts don't support Windows natively at this time) -- [Saxon-HE for Java](http://saxon.sourceforge.net/#F9.9HE) +- [Saxon-HE for Java](http://saxon.sourceforge.net/) - [Hugo](https://gohugo.io/) ## Generating the model documentation diff --git a/json/README.md b/json/README.md index 84d2a6a00f..f4a1afbd24 100644 --- a/json/README.md +++ b/json/README.md @@ -9,9 +9,10 @@ This part of the OSCAL GitHub repository contains useful resources for working w - [Table of Contents](#table-of-contents) - [Available JSON Resources](#available-json-resources) - [JSON Schema for OSCAL Models](#json-schema-for-oscal-models) - - [Validating OSCAL JSON Content](#validating-oscal-json-content) + - [Validating OSCAL JSON Content](#validating-oscal-json-content) - [OSCAL XML to JSON Converters](#oscal-xml-to-json-converters) - - [Converting OSCAL XML Content to JSON](#converting-oscal-xml-content-to-json) + - [Converting OSCAL XML Content to JSON](#converting-oscal-xml-content-to-json) + - [Alternate invocations](#alternate-invocations) @@ -69,16 +70,16 @@ The OSCAL project uses *Saxon-HE* with Java version 8 or greater. The following example uses **Saxon HE** to convert an OSCAL catalog XML file to JSON using one of the NIST-provided [JSON to XML XSLT converters](convert). This example assumes that Java 8+ has been installed and the Saxon-HE jar files have already unzipped. ``` -java -jar "saxon9he.jar" -xsl:"oscal_catalog_xml-to-json-converter.xsl" -s:"oscal-catalog.xml" -o:"oscal-catalog.json" json-indent=yes +java -jar "saxon10he.jar" -xsl:"oscal_catalog_xml-to-json-converter.xsl" -s:"oscal-catalog.xml" -o:"oscal-catalog.json" json-indent=yes ``` -> *Note*: at time of writing, Saxon 9 users are being encouraged to upgrade systems to Saxon use 10, and the stylesheets provided should function equally well or better with the later software. However until we have experience testing it and assuring it runs without error, Saxon 9 is designated here. +> *Note*: at time of writing, Saxon 9 users are being encouraged to upgrade systems to use Saxon 10, and the stylesheets provided should function equally well or better with the later software. Please feel free to use the latest Saxon or indeed any conformant XSLT 3.0 processor. > > Operators of XSLT-based platforms should by all means test these processes with any XSLT 3.0 conformant processor, and report problems to us via Github Issues. Paths\names of these files need to be provided based on the location of the files on your computer: -* The Saxon JAR file is named ```saxon9he.jar```. +* The Saxon JAR file is named ```saxon10he.jar```. * The catalog converter is specified as ```-xsl:"oscal_catalog_xml-to-json-converter.xsl"``` * The source catalog XML file is specified as ```-s:"oscal-catalog.xml"``` * The destination catalog JSON file is specified as ```-o:"oscal-catalog.json"```. diff --git a/xml/README.md b/xml/README.md index c6f9df5ed2..5a6f6b7b42 100644 --- a/xml/README.md +++ b/xml/README.md @@ -9,9 +9,10 @@ This part of the OSCAL GitHub repository contains useful resources for working w - [Table of Contents](#table-of-contents) - [Available XML Resources](#available-xml-resources) - [XML Schema for OSCAL Models](#xml-schema-for-oscal-models) - - [Validating OSCAL XML Content](#validating-oscal-xml-content) + - [Validating OSCAL XML Content](#validating-oscal-xml-content) - [OSCAL JSON to XML Converters](#oscal-json-to-xml-converters) - - [Converting OSCAL JSON Content to XML](#converting-oscal-json-content-to-xml) + - [Converting OSCAL JSON Content to XML](#converting-oscal-json-content-to-xml) + - [Alternate invocations](#alternate-invocations) # Available XML Resources @@ -68,10 +69,10 @@ The OSCAL project uses *Saxon-HE* with Java version 8 or greater. The following example uses **Saxon HE** to convert an OSCAL catalog JSON file to XML using one of the NIST-provided [JSON to XML XSLT converters](convert). This example assumes that has been installed and the Saxon-HE jar files have already unzipped. ``` -java -jar "saxon9he.jar" -xsl:"oscal_catalog_json-to-xml-converter.xsl" -o:"oscal-catalog.xml" -it:from-json file="oscal-catalog.json" +java -jar "saxon10he.jar" -xsl:"oscal_catalog_json-to-xml-converter.xsl" -o:"oscal-catalog.xml" -it:from-json file="oscal-catalog.json" ``` -> *Note*: at time of writing, Saxon 9 users are being encouraged to upgrade systems to use Saxon 10, and the stylesheets provided should function equally well or better with the later software. While Saxon 9 is designated here, please feel free to use the latest Saxon or indeed any conformant XSLT 3.0 processor. +> *Note*: at time of writing, Saxon 9 users are being encouraged to upgrade systems to use Saxon 10, and the stylesheets provided should function equally well or better with the later software. Please feel free to use the latest Saxon or indeed any conformant XSLT 3.0 processor. > > Operators of XSLT-based platforms should by all means test these processes with any XSLT 3.0 conformant processor, and report problems to us via Github Issues. @@ -93,7 +94,7 @@ The configuration just provided will convert a JSON file given as a file referen Use the `json` runtime parameter to do this. On the command line this might be: ``` -java -jar "saxon9he.jar" -xsl:"oscal_catalog_json-to-xml-converter.xsl" -o:"oscal-catalog.xml" -it:from-json json="{ "catalog": {} }" +java -jar "saxon10he.jar" -xsl:"oscal_catalog_json-to-xml-converter.xsl" -o:"oscal-catalog.xml" -it:from-json json="{ "catalog": {} }" ``` (With allowances made for quote marks etc.)