Skip to content

Commit

Permalink
imported-from relations for usnistgov#1023.
Browse files Browse the repository at this point in the history
Co-authored-by: David Waltermire <[email protected]>
  • Loading branch information
aj-stein-nist and david-waltermire committed Aug 25, 2022
1 parent 6489d47 commit 36ab333
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README_validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For OSCAL XML, this schema syntax is [XML Schema Definition (XSD)](https://www.w

Each tool will have its own way to provide for validation. Bindings or configurations to link documents to schemas can be maintained either inside or outside the documents themselves; many tools offer several ways to do this.

Some tools support self-contained validation functionality without full-fledged application frameworks or development environments, with tools like [`xmllint`](http://xmlsoft.org/xmllint.html) offering command-line interfaces. Similarly, you can use the [`ajv-cli`](https://github.com/ajv-validator/ajv-cli) for JSON.
Some tools support self-contained validation functionality without full-fledged application frameworks or development environments, with tools like [`xmllint`](https://gitlab.gnome.org/GNOME/libxml2/) offering command-line interfaces. Similarly, you can use the [`ajv-cli`](https://github.com/ajv-validator/ajv-cli) for JSON.

## What does success look like?

Expand Down
1 change: 1 addition & 0 deletions src/metaschema/oscal_implementation-common_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<!-- ========================================================================================================== -->
&allowed-values-component_component_link-rel;
<enum value="uses-network">This component uses the network provided by the identified network component.</enum>
<enum value="imported-from">The hyperlink identifies a URI pointing to the <code>component</code> in a <code>component-definition</code> that originally defined the <code>component</code>.</enum>
</allowed-values>

<allowed-values target="responsible-role/@role-id" allow-other="yes">
Expand Down
4 changes: 4 additions & 0 deletions src/metaschema/oscal_ssp_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,10 @@
<field ref="remarks" in-xml="WITH_WRAPPER"/>
</model>
<constraint>
<allowed-values target="link/@rel" allow-other="yes">
<!-- TODO: More work needs to be done around link enforcement constraints and requires Metaschema work on recurse-depth-first() recursive index searching. -->
<enum value="imported-from">The hyperlink identifies a URI pointing to the <code>component</code> in a <code>component-definition</code> that originally defined the <code>component</code>.</enum>
</allowed-values>
<allowed-values target=".//responsible-role/@role-id" allow-other="yes">
&allowed-values-responsible-roles-operations;
&allowed-values-responsible-roles-component-production;
Expand Down
4 changes: 2 additions & 2 deletions xml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ XML Schema based on the [XML Schema Definition Language (XSD) 1.1](https://www.w

## Validating OSCAL XML Content

The OSCAL project uses [xmllint](http://xmlsoft.org/xmllint.html) to perform automated validation of all XML-based OSCAL [content](../content) provided in this repository. *xmllint* is an open source tool that can be [downloaded](http://xmlsoft.org/downloads.html), installed, and run on OSX, Linux, and Windows environments.
The OSCAL project uses [xmllint](https://gitlab.gnome.org/GNOME/libxml2/-/tree/master) to perform automated validation of all XML-based OSCAL [content](../content) provided in this repository. *xmllint* is an open source tool that can be [downloaded](http://xmlsoft.org/downloads.html), installed, and run on OSX, Linux, and Windows environments.

The following example uses **xmllint** to perform validation of an OSCAL catalog XML file.

```
xmllint --noout --schema "oscal_catalog_schema.xsd" "catalog.xml"
```

The [online documentation](http://xmlsoft.org/xmllint.html) for *xmllint* provides more information on the commandline arguments.
The [online documentation](https://gitlab.gnome.org/GNOME/libxml2/) for *xmllint* provides more information on the commandline arguments.

# OSCAL JSON to XML Converters

Expand Down

0 comments on commit 36ab333

Please sign in to comment.