Skip to content

Commit

Permalink
Do not filter out id on some fields usnistgov#235
Browse files Browse the repository at this point in the history
As reported in the issue, debugging indicated that filtering the IDs of some
fields in array constructs (in the XSLT M4 supermodel intermediate format) are
dropping in later stages as a result, lead to invalid JSON serialization.
  • Loading branch information
aj-stein-nist committed Sep 16, 2022
1 parent a11515b commit 64681bb
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions toolchains/xslt-M4/converter-gen/supermodel-to-json.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
<xsl:element name="{(@in-json[matches(.,'\S')],'string')[1]}"
namespace="http://www.w3.org/2005/xpath-functions">
<!-- emit a key only if needed -->
<xsl:if test="exists(parent::field/child::flag) or exists(parent::field/parent::assembly) or count(parent::field/parent::group[@in-json='SINGLETON_OR_ARRAY']/child::*) eq 1">
<xsl:copy-of
select="((../flag[@key = $key-flag-name], parent::field[@in-json = 'SCALAR'])/@key, @key)[1]"/>
<!-- overriding the key -->
Expand All @@ -148,7 +147,6 @@
mode="cast-data"/>
</xsl:attribute>
</xsl:if>
</xsl:if>
<xsl:apply-templates select="." mode="cast-data"/>
</xsl:element>
</xsl:template>
Expand Down

0 comments on commit 64681bb

Please sign in to comment.