Skip to content

Commit

Permalink
Publishing generated metaschema resources [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
oscalbuilder committed Jun 29, 2023
1 parent bb4a4c4 commit 7dea8c0
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 380 deletions.
40 changes: 10 additions & 30 deletions json/convert/oscal_complete_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,13 @@
<assembly name="import" gi="import">
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="include-all"/>
<xsl:apply-templates select="include-controls"/>
<xsl:for-each-group select="include-controls" group-by="true()">
<group in-json="ARRAY" key="include-controls">
<xsl:apply-templates select="current-group()">
<xsl:with-param name="with-key" select="false()"/>
</xsl:apply-templates>
</group>
</xsl:for-each-group>
<xsl:for-each-group select="exclude-controls" group-by="true()">
<group in-json="ARRAY" key="exclude-controls">
<xsl:apply-templates select="current-group()">
Expand Down Expand Up @@ -3489,7 +3495,7 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/include-controls/@with-child-controls"
<xsl:template match="profile/import/include-controls/@with-child-controls | profile/import/exclude-controls/@with-child-controls | profile/merge/custom//group/insert-controls/include-controls/@with-child-controls | profile/merge/custom//group/insert-controls/exclude-controls/@with-child-controls | profile/merge/custom/insert-controls/include-controls/@with-child-controls | profile/merge/custom/insert-controls/exclude-controls/@with-child-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
Expand All @@ -3499,16 +3505,6 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/include-controls/@with-parent-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
name="with-parent-controls"
key="with-parent-controls"
gi="with-parent-controls">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="matching/@pattern"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
Expand All @@ -3519,16 +3515,6 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/exclude-controls/@with-child-controls | profile/merge/custom//group/insert-controls/include-controls/@with-child-controls | profile/merge/custom//group/insert-controls/exclude-controls/@with-child-controls | profile/merge/custom/insert-controls/include-controls/@with-child-controls | profile/merge/custom/insert-controls/exclude-controls/@with-child-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
name="with-child-controls"
key="with-child-controls"
gi="with-child-controls">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/merge/combine/@method"
priority="5"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down Expand Up @@ -9156,17 +9142,11 @@
</field>
</xsl:template>
<xsl:template match="profile/import/include-controls"
priority="6"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="include-controls"
key="include-controls"
gi="include-controls">
<xsl:if test="$with-key">
<xsl:attribute name="key">include-controls</xsl:attribute>
</xsl:if>
<assembly name="select-control-by-id" gi="include-controls">
<xsl:apply-templates select="@with-child-controls"/>
<xsl:apply-templates select="@with-parent-controls"/>
<xsl:for-each-group select="with-id" group-by="true()">
<group in-json="ARRAY" key="with-ids">
<xsl:apply-templates select="current-group()">
Expand Down
40 changes: 10 additions & 30 deletions json/convert/oscal_profile_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,13 @@
<assembly name="import" gi="import">
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="include-all"/>
<xsl:apply-templates select="include-controls"/>
<xsl:for-each-group select="include-controls" group-by="true()">
<group in-json="ARRAY" key="include-controls">
<xsl:apply-templates select="current-group()">
<xsl:with-param name="with-key" select="false()"/>
</xsl:apply-templates>
</group>
</xsl:for-each-group>
<xsl:for-each-group select="exclude-controls" group-by="true()">
<group in-json="ARRAY" key="exclude-controls">
<xsl:apply-templates select="current-group()">
Expand Down Expand Up @@ -923,7 +929,7 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/include-controls/@with-child-controls"
<xsl:template match="profile/import/include-controls/@with-child-controls | profile/import/exclude-controls/@with-child-controls | profile/merge/custom//group/insert-controls/include-controls/@with-child-controls | profile/merge/custom//group/insert-controls/exclude-controls/@with-child-controls | profile/merge/custom/insert-controls/include-controls/@with-child-controls | profile/merge/custom/insert-controls/exclude-controls/@with-child-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
Expand All @@ -933,16 +939,6 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/include-controls/@with-parent-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
name="with-parent-controls"
key="with-parent-controls"
gi="with-parent-controls">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="matching/@pattern"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
Expand All @@ -953,16 +949,6 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/import/exclude-controls/@with-child-controls | profile/merge/custom//group/insert-controls/include-controls/@with-child-controls | profile/merge/custom//group/insert-controls/exclude-controls/@with-child-controls | profile/merge/custom/insert-controls/include-controls/@with-child-controls | profile/merge/custom/insert-controls/exclude-controls/@with-child-controls"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="token"
name="with-child-controls"
key="with-child-controls"
gi="with-child-controls">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/merge/combine/@method"
priority="5"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down Expand Up @@ -2216,17 +2202,11 @@
</field>
</xsl:template>
<xsl:template match="profile/import/include-controls"
priority="6"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="include-controls"
key="include-controls"
gi="include-controls">
<xsl:if test="$with-key">
<xsl:attribute name="key">include-controls</xsl:attribute>
</xsl:if>
<assembly name="select-control-by-id" gi="include-controls">
<xsl:apply-templates select="@with-child-controls"/>
<xsl:apply-templates select="@with-parent-controls"/>
<xsl:for-each-group select="with-id" group-by="true()">
<group in-json="ARRAY" key="with-ids">
<xsl:apply-templates select="current-group()">
Expand Down
84 changes: 6 additions & 78 deletions json/schema/oscal_complete_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1265,83 +1265,11 @@
"$ref" : "#/definitions/URIReferenceDatatype" },
"include-all" :
{ "$ref" : "#assembly_oscal-control-common_include-all" },
"" :
{ "anyOf" :
[
{ "title" : "Select Control",
"description" : "Select a control or controls from an imported control set.",
"type" : "object",
"properties" :
{ "with-child-controls" :
{ "title" : "Include Contained Controls with Control",
"description" : "When a control is included, whether its child (dependent) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-parent-controls" :
{ "title" : "Include Parent Controls with Control",
"description" : "When a control is included, whether its parent (ancestor) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-ids" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#field_oscal-profile_with-id" } },
"matching" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_matching" } } },
"additionalProperties" : false },

{ "type" : "array",
"minItems" : 1,
"items" :
{ "title" : "Select Control",
"description" : "Select a control or controls from an imported control set.",
"type" : "object",
"properties" :
{ "with-child-controls" :
{ "title" : "Include Contained Controls with Control",
"description" : "When a control is included, whether its child (dependent) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-parent-controls" :
{ "title" : "Include Parent Controls with Control",
"description" : "When a control is included, whether its parent (ancestor) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-ids" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#field_oscal-profile_with-id" } },
"matching" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_matching" } } },
"additionalProperties" : false } } ] },
"include-controls" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_select-control-by-id" } },
"exclude-controls" :
{ "type" : "array",
"minItems" : 1,
Expand Down Expand Up @@ -1619,7 +1547,7 @@
"additionalProperties" : false } } },
"additionalProperties" : false },
"oscal-complete-oscal-profile:insert-controls" :
{ "title" : "Select Controls",
{ "title" : "Insert Controls",
"description" : "Specifies which controls to use in the containing context.",
"$id" : "#assembly_oscal-profile_insert-controls",
"type" : "object",
Expand Down
84 changes: 6 additions & 78 deletions json/schema/oscal_profile_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,83 +44,11 @@
"$ref" : "#/definitions/URIReferenceDatatype" },
"include-all" :
{ "$ref" : "#assembly_oscal-control-common_include-all" },
"" :
{ "anyOf" :
[
{ "title" : "Select Control",
"description" : "Select a control or controls from an imported control set.",
"type" : "object",
"properties" :
{ "with-child-controls" :
{ "title" : "Include Contained Controls with Control",
"description" : "When a control is included, whether its child (dependent) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-parent-controls" :
{ "title" : "Include Parent Controls with Control",
"description" : "When a control is included, whether its parent (ancestor) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-ids" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#field_oscal-profile_with-id" } },
"matching" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_matching" } } },
"additionalProperties" : false },

{ "type" : "array",
"minItems" : 1,
"items" :
{ "title" : "Select Control",
"description" : "Select a control or controls from an imported control set.",
"type" : "object",
"properties" :
{ "with-child-controls" :
{ "title" : "Include Contained Controls with Control",
"description" : "When a control is included, whether its child (dependent) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-parent-controls" :
{ "title" : "Include Parent Controls with Control",
"description" : "When a control is included, whether its parent (ancestor) controls are also included.",
"allOf" :
[
{ "$ref" : "#/definitions/TokenDatatype" },

{ "enum" :
[ "yes",
"no" ] } ] },
"with-ids" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#field_oscal-profile_with-id" } },
"matching" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_matching" } } },
"additionalProperties" : false } } ] },
"include-controls" :
{ "type" : "array",
"minItems" : 1,
"items" :
{ "$ref" : "#assembly_oscal-profile_select-control-by-id" } },
"exclude-controls" :
{ "type" : "array",
"minItems" : 1,
Expand Down Expand Up @@ -398,7 +326,7 @@
"additionalProperties" : false } } },
"additionalProperties" : false },
"oscal-profile-oscal-profile:insert-controls" :
{ "title" : "Select Controls",
{ "title" : "Insert Controls",
"description" : "Specifies which controls to use in the containing context.",
"$id" : "#assembly_oscal-profile_insert-controls",
"type" : "object",
Expand Down
Loading

0 comments on commit 7dea8c0

Please sign in to comment.