Skip to content

Commit

Permalink
Updated the profile resolution test helper to allow for directly call…
Browse files Browse the repository at this point in the history
…ing it and to normalize a few additional fields that are mutable between the expected and actual examples.
  • Loading branch information
david-waltermire committed Jan 26, 2022
1 parent 65d97ba commit e277f19
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/utils/util/resolver-pipeline/oscal-profile-test-helper.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
-->

<xsl:output method="xml" indent="yes"/>

<xsl:output method="xml"/>
<xsl:strip-space
elements="catalog metadata param control group back-matter prop link part usage constraint guideline select remarks description test revisions revision role location party responsible-party address external-id resource citation rlink base64"/>

Expand All @@ -32,7 +32,13 @@
-->

<xsl:template match="/">
<xsl:param name="source" select="." as="document-node()"/>
<xsl:document>
<xsl:apply-templates select="$source" mode="scrubbing"/>
</xsl:document>
</xsl:template>

<xsl:function name="opr:scrub" as="document-node()">
<xsl:param name="n" as="node()"/>
<xsl:document>
Expand All @@ -54,7 +60,15 @@
<xsl:next-match/>
</xsl:if>
</xsl:template>


<xsl:template mode="scrubbing" match="catalog/metadata/prop[@name='resolution-tool']/@value">
<xsl:attribute name="value">...</xsl:attribute>
</xsl:template>

<xsl:template mode="scrubbing" match="catalog/metadata/link[@rel='source-profile']/@href">
<xsl:attribute name="href">...</xsl:attribute>
</xsl:template>

<xsl:template mode="scrubbing" match="last-modified">
<xsl:copy>...</xsl:copy>
</xsl:template>
Expand Down

0 comments on commit e277f19

Please sign in to comment.