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
david-waltermire-nist authored and david-waltermire committed Aug 23, 2022
1 parent 9aeea54 commit 0a6189a
Show file tree
Hide file tree
Showing 8 changed files with 1,172 additions and 20 deletions.
266 changes: 262 additions & 4 deletions json/convert/oscal_complete_xml-to-json-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@
<xsl:apply-templates select="remarks"/>
</assembly>
</xsl:template>
<xsl:template match="system-implementation/component | local-definitions/component | assessment-assets/component | local-definitions/component | assessment-assets/component | local-definitions/component"
<xsl:template match="system-implementation/component | local-definitions/component | assessment-assets/component | local-definitions/component | assessment-assets/component | local-definitions/component | assessment-assets/component"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="system-component" gi="component">
Expand Down Expand Up @@ -2709,6 +2709,7 @@
</xsl:apply-templates>
</group>
</xsl:for-each-group>
<xsl:apply-templates select="assessment-assets"/>
<xsl:apply-templates select="remarks"/>
</assembly>
</xsl:template>
Expand Down Expand Up @@ -3924,7 +3925,7 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="system-security-plan/system-implementation/component/status/@state | assessment-plan/local-definitions/component/status/@state | assessment-plan/assessment-assets/component/status/@state | assessment-results/result/local-definitions/component/status/@state | assessment-results/result/local-definitions/assessment-assets/component/status/@state | plan-of-action-and-milestones/local-definitions/component/status/@state"
<xsl:template match="system-security-plan/system-implementation/component/status/@state | assessment-plan/local-definitions/component/status/@state | assessment-plan/assessment-assets/component/status/@state | assessment-results/result/local-definitions/component/status/@state | assessment-results/result/local-definitions/assessment-assets/component/status/@state | plan-of-action-and-milestones/local-definitions/component/status/@state | plan-of-action-and-milestones/local-definitions/assessment-assets/component/status/@state"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
Expand Down Expand Up @@ -4251,7 +4252,7 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="assessment-plan/assessment-assets/assessment-platform/@uuid | assessment-results/result/local-definitions/assessment-assets/assessment-platform/@uuid"
<xsl:template match="assessment-plan/assessment-assets/assessment-platform/@uuid | assessment-results/result/local-definitions/assessment-assets/assessment-platform/@uuid | plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/@uuid"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
Expand All @@ -4262,7 +4263,7 @@
<xsl:value-of select="."/>
</flag>
</xsl:template>
<xsl:template match="assessment-plan/assessment-assets/assessment-platform/uses-component/@component-uuid | assessment-results/result/local-definitions/assessment-assets/assessment-platform/uses-component/@component-uuid"
<xsl:template match="assessment-plan/assessment-assets/assessment-platform/uses-component/@component-uuid | assessment-results/result/local-definitions/assessment-assets/assessment-platform/uses-component/@component-uuid | plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/uses-component/@component-uuid"
priority="8"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<flag in-json="string"
Expand Down Expand Up @@ -25579,6 +25580,263 @@
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/title"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="title"
key="title"
gi="title"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">title</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/description"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field in-xml="WITH_WRAPPER"
collapsible="no"
as-type="markup-multiline"
name="description"
key="description"
gi="description"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">description</xsl:attribute>
</xsl:if>
<value as-type="markup-multiline" in-json="string">
<xsl:for-each-group select="p | ul | ol | pre | h1 | h2 | h3 | h4 | h5 | h6 | table"
group-by="true()">
<xsl:apply-templates select="current-group()" mode="cast-prose"/>
</xsl:for-each-group>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/purpose"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="purpose"
key="purpose"
gi="purpose"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">purpose</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/link/text"
priority="9"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="text"
key="text"
gi="text"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">text</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/status"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="status" key="status" gi="status">
<xsl:if test="$with-key">
<xsl:attribute name="key">status</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@state"/>
<xsl:apply-templates select="remarks"/>
</assembly>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/responsible-role/link/text"
priority="11"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="text"
key="text"
gi="text"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">text</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/component/protocol/title"
priority="9"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="title"
key="title"
gi="title"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">title</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform"
priority="6"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="assessment-platform" gi="assessment-platform">
<xsl:apply-templates select="@uuid"/>
<xsl:apply-templates select="title"/>
<xsl:for-each-group select="prop" group-by="true()">
<group in-json="ARRAY" key="props">
<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="link" group-by="true()">
<group in-json="ARRAY" key="links">
<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="uses-component" group-by="true()">
<group in-json="ARRAY" key="uses-components">
<xsl:apply-templates select="current-group()">
<xsl:with-param name="with-key" select="false()"/>
</xsl:apply-templates>
</group>
</xsl:for-each-group>
<xsl:apply-templates select="remarks"/>
</assembly>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/title"
priority="7"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="title"
key="title"
gi="title"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">title</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/link/text"
priority="9"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="text"
key="text"
gi="text"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">text</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/uses-component"
priority="8"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<assembly name="uses-component" gi="uses-component">
<xsl:apply-templates select="@component-uuid"/>
<xsl:for-each-group select="prop" group-by="true()">
<group in-json="ARRAY" key="props">
<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="link" group-by="true()">
<group in-json="ARRAY" key="links">
<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="responsible-party" group-by="true()">
<group in-json="ARRAY" key="responsible-parties">
<xsl:apply-templates select="current-group()">
<xsl:with-param name="with-key" select="false()"/>
</xsl:apply-templates>
</group>
</xsl:for-each-group>
<xsl:apply-templates select="remarks"/>
</assembly>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/uses-component/link/text"
priority="11"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="text"
key="text"
gi="text"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">text</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/local-definitions/assessment-assets/assessment-platform/uses-component/responsible-party/link/text"
priority="13"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
<xsl:param name="with-key" select="true()"/>
<field collapsible="no"
as-type="markup-line"
name="text"
key="text"
gi="text"
in-json="SCALAR">
<xsl:if test="$with-key">
<xsl:attribute name="key">text</xsl:attribute>
</xsl:if>
<value as-type="markup-line" in-json="string">
<xsl:apply-templates mode="cast-prose"/>
</value>
</field>
</xsl:template>
<xsl:template match="plan-of-action-and-milestones/observation/title"
priority="5"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/1.0">
Expand Down
Loading

0 comments on commit 0a6189a

Please sign in to comment.