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

XSLT M4 implementation repo cleanup #172

Merged
merged 13 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions test-suite/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
A test suite capable of testing any given implementation of the Metaschema toolchain.
Contains various materials for testing any and various implementations of the Metaschema toolchain or parts of it.

Folders here include:

### `docs-models`

An example metaschema for mocking up documentation generation.

### `schema-generation`

To use: under Bash, run ./run-tests.sh in folder schema-generation

./run-tests --help gives help.

./run-tests.sh [testdir] runs tests only in a particular test directory.
./run-tests.sh [testdir] runs tests only in a particular test directory.

### `schema-generation`

Unit testing over handmade mini metaschemas. Due for maintenance.

### `worked-exaples`

With one more testing metaschemas exercising different features.

### `metaschema-xspec`

The *beginnings* of XSpec-based unit testing of metaschema

### `oscal`

Copies of OSCAL metaschemas for testing (not normative).

26 changes: 26 additions & 0 deletions test-suite/docs-models/shadow-imported_metaschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../../toolchains/xslt-M4/validate/metaschema-check.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<METASCHEMA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/metaschema/1.0 ../../toolchains/xslt-M4/validate/metaschema.xsd"
xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">

<schema-name>Imported Metaschema</schema-name>
<schema-version>1.0</schema-version>
<short-name>imported</short-name>
<namespace>http://csrc.nist.gov/ns/oscal/1.0</namespace>

<define-assembly name="imported-flags">
<formal-name>Assembly that includes global and local flags</formal-name>
<description>This assembly references a global flag that is shadowed by a global flag defined in the importing metaschema.</description>
<flag ref="global-flag">
<remarks>
<p>This reference should be to the globally scoped flag "global-flag" from the imported metaschema.</p>
</remarks>
</flag>
</define-assembly>

<define-flag name="global-flag">
<formal-name>Global Flag - Imported Metaschema</formal-name>
<description>A flag from the importing metaschema. It's scope is global and it's shadowed by the definition with the same name in the importing metaschema.</description>
</define-flag>
</METASCHEMA>
36 changes: 36 additions & 0 deletions test-suite/docs-models/shadow-importing_metaschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../../toolchains/xslt-M4/validate/metaschema-check.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<METASCHEMA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/metaschema/1.0 ../../toolchains/xslt-M4/validate/metaschema.xsd"
xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">

<schema-name>Importing Metaschema</schema-name>
<schema-version>1.0</schema-version>
<short-name>importing</short-name>
<namespace>http://csrc.nist.gov/ns/oscal/1.0</namespace>

<import href="shadow-importing_metaschema.xml"/>

<define-assembly name="importing-A">
<formal-name>Assembly that global flags</formal-name>
<description>This assembly references a global flag that shadows a global flag defined in an imported metaschema.</description>
<root-name>including-flags</root-name>
<flag ref="global-flag">
<remarks>
<p>This reference should be to the globally scoped flag "global-flag" from the importing metaschema. This definition is taking precedence over the other definition imported (with the same name).</p>
</remarks>
</flag>
<model>
<assembly ref="imported-flags">
<remarks>
<p>This is the imported "imported-flags" assembly.</p>
</remarks>
</assembly>
</model>
</define-assembly>

<define-flag name="global-flag">
<formal-name>Global Flag - Importing Metaschema</formal-name>
<description>A flag from the importing metaschema. It's scope is global. This should be marked as a shadowing of another imported flag.</description>
</define-flag>
</METASCHEMA>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading