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 Nov 1, 2022
1 parent a52aa15 commit 69cc108
Show file tree
Hide file tree
Showing 36 changed files with 360 additions and 0 deletions.
12 changes: 12 additions & 0 deletions json/convert/oscal_assessment-plan_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -1161,6 +1162,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="assessment-plan/metadata/document-id/@scheme | assessment-plan/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_assessment-results_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -1619,6 +1620,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="assessment-results/metadata/document-id/@scheme | assessment-results/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_catalog_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -823,6 +824,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="catalog/metadata/document-id/@scheme | catalog/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_complete_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -3021,6 +3022,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="catalog/metadata/document-id/@scheme | catalog/back-matter/resource/document-id/@scheme | mapping-collection/metadata/document-id/@scheme | mapping-collection/back-matter/resource/document-id/@scheme | profile/metadata/document-id/@scheme | profile/back-matter/resource/document-id/@scheme | component-definition/metadata/document-id/@scheme | component-definition/back-matter/resource/document-id/@scheme | system-security-plan/metadata/document-id/@scheme | system-security-plan/back-matter/resource/document-id/@scheme | assessment-plan/metadata/document-id/@scheme | assessment-plan/back-matter/resource/document-id/@scheme | assessment-results/metadata/document-id/@scheme | assessment-results/back-matter/resource/document-id/@scheme | plan-of-action-and-milestones/metadata/document-id/@scheme | plan-of-action-and-milestones/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_component_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -628,6 +629,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="component-definition/metadata/document-id/@scheme | component-definition/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_mapping_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -600,6 +601,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="mapping-collection/metadata/document-id/@scheme | mapping-collection/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_poam_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -1272,6 +1273,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/metadata/document-id/@scheme | plan-of-action-and-milestones/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_profile_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -748,6 +749,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="profile/metadata/document-id/@scheme | profile/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
12 changes: 12 additions & 0 deletions json/convert/oscal_ssp_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<xsl:apply-templates select="@href"/>
<xsl:apply-templates select="@rel"/>
<xsl:apply-templates select="@media-type"/>
<xsl:apply-templates select="@resource-fragment"/>
<xsl:apply-templates select="text"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -1113,6 +1114,17 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="link/@resource-fragment"
priority="1"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="system-security-plan/metadata/document-id/@scheme | system-security-plan/back-matter/resource/document-id/@scheme"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_assessment-plan_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_assessment-results_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_catalog_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_complete_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_component_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_mapping_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_poam_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_profile_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
4 changes: 4 additions & 0 deletions json/schema/oscal_ssp_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,10 @@
{ "title" : "Media Type",
"description" : "A label that indicates the nature of a resource, as a data serialization or format.",
"$ref" : "#/definitions/StringDatatype" },
"resource-fragment" :
{ "title" : "Resource Fragment",
"description" : "In case where the href points to a back-matter/resource, this value will indicate the URI fragment to append to any rlink associated with the resource. This value MUST be URI encoded.",
"$ref" : "#/definitions/StringDatatype" },
"text" :
{ "title" : "Link Text",
"description" : "A textual label to associate with the link, which may be used for presentation in a tool.",
Expand Down
14 changes: 14 additions & 0 deletions xml/convert/oscal_assessment-plan_json-to-xml-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
<xsl:apply-templates select="*[@key='href']"/>
<xsl:apply-templates select="*[@key='rel']"/>
<xsl:apply-templates select="*[@key='media-type']"/>
<xsl:apply-templates select="*[@key='resource-fragment']"/>
<xsl:apply-templates select="*[@key='text']"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -721,6 +722,19 @@
<xsl:template match="j:array[@key='links']/j:map/j:string[@key='media-type']"
mode="keep-value-property"
priority="8"><!-- Not keeping the flag here. --></xsl:template>
<xsl:template match="j:array[@key='links']/j:map/j:string[@key='resource-fragment']"
priority="1"><!-- XML match="link/@resource-fragment" -->
<flag in-json="string"
as-type="string"
name="resource-fragment"
key="resource-fragment"
gi="resource-fragment">
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="j:array[@key='links']/j:map/j:string[@key='resource-fragment']"
mode="keep-value-property"
priority="8"><!-- Not keeping the flag here. --></xsl:template>
<xsl:template match="j:map[@key='assessment-plan']/j:map[@key='metadata']/j:array[@key='document-ids']/j:map/j:string[@key='scheme'] | j:map[@key='assessment-plan']/j:map[@key='back-matter']/j:array[@key='resources']/j:map/j:array[@key='document-ids']/j:map/j:string[@key='scheme']"
priority="6"><!-- XML match="assessment-plan/metadata/document-id/@scheme | assessment-plan/back-matter/resource/document-id/@scheme" -->
<flag in-json="string"
Expand Down
Loading

0 comments on commit 69cc108

Please sign in to comment.