Skip to content

Commit

Permalink
Upgrade Saxon use to 10.6 (usnistgov#1187)
Browse files Browse the repository at this point in the history
* Updates for Saxon 10.6
* updating to latest metaschema toolchain
  • Loading branch information
david-waltermire authored and iMichaela committed Apr 7, 2022
1 parent 1cfd2b6 commit ba12d96
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/metaschema-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions build/ci-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
```

Expand Down
4 changes: 2 additions & 2 deletions build/ci-cd/python/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build/ci-cd/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 1 addition & 5 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- /TOC -->

Expand Down Expand Up @@ -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"```.
Expand Down
11 changes: 6 additions & 5 deletions xml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<!-- /TOC -->
# Available XML Resources
Expand Down Expand Up @@ -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.
Expand All @@ -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.)
Expand Down

0 comments on commit ba12d96

Please sign in to comment.