Skip to content

Commit

Permalink
Repaired error in profile metaschema, with Schematron check to detect…
Browse files Browse the repository at this point in the history
… it (#6)
  • Loading branch information
wendellpiez authored and david-waltermire committed Jun 10, 2019
1 parent 0d37e43 commit 03b9254
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build/metaschema/lib/metaschema-check.sch
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
<sch:let name="decl" value="key('definition-by-name',@named,$composed-metaschema)"/>
<sch:assert test="exists($decl)">No definition found for '<sch:value-of select="@named"/>' <sch:value-of select="local-name()"/></sch:assert>
<sch:assert role="warning" test="empty($decl) or exists(self::m:field|self::m:assembly) or exists($decl/@group-as)">Reference is made to <sch:value-of select="local-name()"/> '<sch:value-of select="@named"/>', but their definition does not give a group name.</sch:assert>
<sch:assert test="empty($decl) or empty(@address) or ($decl/@address = @address)">The referenced definition has <sch:value-of select="if (exists($decl/@address)) then ('address ''' || $decl/@address || '''') else 'no address'"/></sch:assert>
<sch:assert test="exists($decl/@acquire-from) or empty(@address) or ($decl/m:flag/@name = @address)">The referenced definition has no flag named '<sch:value-of select="@address"/>'</sch:assert>
<sch:assert test="empty($decl/@acquire-from) or empty(@address) or not($decl/m:flag/@name = @address) or ($decl/m:flag[@name = current()/@address]/@required='yes')">The target definition has no required flag named <sch:value-of select="@address"/></sch:assert>
<sch:assert test="(empty($decl/@address) and empty(@address)) or ($decl/@address = @address)">The referenced definition has <sch:value-of select="if (exists($decl/@address)) then ('address ''' || $decl/@address || '''') else 'no address'"/></sch:assert>
<!--<sch:assert test="exists($decl/@acquire-from) or empty(@address) or ($decl/m:flag/@name = @address)">The referenced definition has no flag named '<sch:value-of select="@address"/>'</sch:assert>
<sch:assert test="empty($decl/@acquire-from) or empty(@address) or not($decl/m:flag/@name = @address) or ($decl/m:flag[@name = current()/@address]/@required='yes')">The target definition has no required flag named <sch:value-of select="@address"/></sch:assert>-->


<sch:report test="@named = ../(* except current())/@named">Everything named the same must appear together</sch:report>
Expand Down
10 changes: 5 additions & 5 deletions src/metaschema/oscal_profile_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<formal-name>Modify controls</formal-name>
<description>Set parameters or amend controls in resolution</description>
<model>
<assemblies named="set"/>
<assemblies named="set" address="param-id"/>
<assemblies named="alter"/>
</model>
</define-assembly>
Expand Down Expand Up @@ -354,12 +354,12 @@
<formal-name>Addition</formal-name>
<description>Specifies contents to be added into controls or subcontrols, in resolution</description>
<model>
<field named="title"/>
<field named="title"/>
<assemblies named="param" address="id"/>
<fields named="prop"/>
<fields named="link"/>
<fields named="prop"/>
<fields named="link"/>
<assemblies named="part"/>
<assembly named="citation-list"/>
<assembly named="citation-list"/>
</model>
</define-assembly>
<define-flag datatype="NCName" name="control-id">
Expand Down

0 comments on commit 03b9254

Please sign in to comment.