Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction to metaschema processing regression exposed by docs glitch #167

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,163 changes: 0 additions & 7,163 deletions test-suite/test/SilentEsper-oscal-package-schema.json

This file was deleted.

1,075 changes: 0 additions & 1,075 deletions test-suite/test/catalog-schema.json

This file was deleted.

11 changes: 0 additions & 11 deletions test-suite/test/micro-catalog.json

This file was deleted.

1,143 changes: 0 additions & 1,143 deletions test-suite/test/oscal_catalog_schema-rc1.json

This file was deleted.

1,075 changes: 0 additions & 1,075 deletions test-suite/test/oscal_catalog_schema-rc2.json

This file was deleted.

42 changes: 0 additions & 42 deletions test-suite/test/schema-schema.json

This file was deleted.

46 changes: 19 additions & 27 deletions toolchains/xslt-M4/compose/make-model-map.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@
<!-- then, the remarks off the definition or reference -->
<xsl:sequence select="$instance/remarks"/>
</xsl:variable>
<xsl:variable name="with-remarks">
<!-- when doing a global definition get its remarks first -->
<xsl:if test="not(. is $instance)">
<xsl:sequence select="remarks"/>
</xsl:if>
<!-- then, the remarks off a local definition or reference, or a global called at the top -->
<xsl:sequence select="$instance/remarks"/>
</xsl:variable>

<xsl:element name="{ $type }" namespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
<xsl:for-each select="self::define-assembly[empty(model)]">
Expand Down Expand Up @@ -119,33 +111,33 @@
</xsl:template>

<xsl:template match="define-flag" mode="build">
<xsl:param name="instance" select="."/>
<xsl:variable name="given-type" select="$instance/@as-type"/>
<xsl:variable name="is-required" select="($instance/@required | @required) ='yes'"/>
<xsl:variable name="using-name" select="$instance/(use-name,@ref)[1]"/>
<xsl:param name="instance" select="."/>

<xsl:variable name="given-type" select="$instance/@as-type"/>
<xsl:variable name="is-required" select="($instance/@required | @required) = 'yes'"/>
<xsl:variable name="using-name" select="$instance/(use-name, @ref)[1]"/>
<xsl:variable name="with-remarks">
<!-- when doing a global definition for an instance, get its remarks first -->
<xsl:if test="not(. is $instance)">
<xsl:sequence select="remarks"/>
</xsl:if>
<!-- then, the remarks off a local definition or reference, or a global called at the top -->
<!-- then, the remarks off a local definition or reference, or a global called at the top -->
<xsl:sequence select="$instance/remarks"/>
</xsl:variable>

<flag max-occurs="1" min-occurs="{if ($is-required) then 1 else 0}" as-type="{ ($given-type,@as-type, 'string')[1] }">
<xsl:apply-templates select="@*" mode="build"/>

<flag max-occurs="1" min-occurs="{if ($is-required) then 1 else 0}"
as-type="{ ($given-type,@as-type, 'string')[1] }">

<xsl:apply-templates select="@*" mode="build"/>
<xsl:apply-templates select="$instance/@*" mode="build"/>

<xsl:for-each select="parent::METASCHEMA">
<xsl:attribute name="scope">global</xsl:attribute>
</xsl:for-each>
<xsl:attribute name="gi" select="($using-name,use-name,@name,@ref)[1]"/>
<xsl:attribute name="key" select="($using-name,use-name,@name,@ref)[1]"/>

<xsl:attribute name="gi" select="($using-name, use-name, @name, @ref)[1]"/>
<xsl:attribute name="key" select="($using-name, use-name, @name, @ref)[1]"/>

<xsl:apply-templates select="formal-name | description"/>
<xsl:apply-templates select="constraint"/>
<xsl:apply-templates select="$with-remarks"/>
Expand Down Expand Up @@ -189,19 +181,19 @@

<xsl:template mode="build" match="model//assembly">
<xsl:apply-templates mode="build" select="key('global-assemblies', @_key-ref)">
<xsl:with-param name="reference" select="."/>
<xsl:with-param name="instance" select="."/>
</xsl:apply-templates>
</xsl:template>

<xsl:template mode="build" match="model//field">
<xsl:apply-templates mode="build" select="key('global-fields', @_key-ref)">
<xsl:with-param name="reference" select="."/>
<xsl:with-param name="instance" select="."/>
</xsl:apply-templates>
</xsl:template>

<xsl:template mode="build" match="flag">
<xsl:apply-templates mode="build" select="key('global-flags', @_key-ref)">
<xsl:with-param name="reference" select="."/>
<xsl:with-param name="instance" select="."/>
</xsl:apply-templates>
</xsl:template>

Expand Down
75 changes: 0 additions & 75 deletions toolchains/xslt-M4/produce-xsd-OLD.xpl

This file was deleted.

31 changes: 0 additions & 31 deletions toolchains/xslt-M4/scratch.xpl

This file was deleted.