Skip to content

Commit

Permalink
Add possible Schematron documentation checks
Browse files Browse the repository at this point in the history
This is the product of the meeting and spike where we pair-programmed
and came up with example Schematron rules for tentative editorial
standards that can be used for reviews of models and embedded docs as
part of #801.

Co-authored-by: Chris Compton <[email protected]>
Co-authored-by: Rene Rene Tshiteya <[email protected]>
Co-authored-by: Wendell Piez <[email protected]>
  • Loading branch information
4 people authored and david-waltermire committed Oct 30, 2022
1 parent e4f710c commit 450b8c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/utils/schematron/oscal-documentation.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0"
xmlns:nm="http://csrc.nist.gov/ns/metaschema"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
xmlns:oscal="http://csrc.nist.gov/ns/oscal/1.0">

<sch:ns uri="http://csrc.nist.gov/ns/oscal/metaschema/1.0" prefix="m"/>
<sch:ns uri="http://csrc.nist.gov/ns/metaschema" prefix="nm"/>

<sch:pattern>
<sch:rule context="m:description">
<sch:assert role="error" test="ends-with(.,'.')" id="description-ends-with-dot">Description should end with a period.</sch:assert>
<sch:assert role="error" test="string-length(.) gt 6" id="description-long-enough">Description is too short.</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>

0 comments on commit 450b8c8

Please sign in to comment.