Skip to content

Commit

Permalink
Make trace messages neater
Browse files Browse the repository at this point in the history
  • Loading branch information
galtm authored and aj-stein-nist committed Sep 28, 2023
1 parent 07f8d22 commit f8f5941
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils/resolver-pipeline/oscal-profile-RESOLVE.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<xsl:variable name="louder" select="$trace = 'on'"/>

<xsl:variable name="home" select="/"/>
<xsl:variable name="home-filename" select="$home/base-uri() => replace('.*/','')"/>

<!-- If true, do not record profile URI in output catalog's source-profile
metadata, due to privacy or security concerns. -->
Expand All @@ -72,7 +73,7 @@
Each represents a stage in processing.
The result of each processing step is passed to the next step as its input, until no steps are left. -->
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="yes"> RESOLVING PROFILE { base-uri($source) } </xsl:with-param>
<xsl:with-param name="msg" expand-text="yes">RESOLVING PROFILE { document-uri($source) } </xsl:with-param>
</xsl:call-template>
<xsl:iterate select="$transformation-sequence/*">
<xsl:param name="doc" select="$source" as="document-node()"/>
Expand Down Expand Up @@ -106,7 +107,7 @@
<xsl:param name="sourcedoc" as="document-node()"/>
<xsl:variable name="xslt-spec" select="."/>
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="true">Start of step { count(.|preceding-sibling::*) }: XSLT { $xslt-spec }, document {$home/base-uri() => replace('.*/','')} ... </xsl:with-param>
<xsl:with-param name="msg" expand-text="true">Step { count(.|preceding-sibling::*) } start : document { $home-filename }, XSLT { $xslt-spec }</xsl:with-param>
</xsl:call-template>
<xsl:variable name="runtime-params" as="map(xs:QName,item()*)">
<xsl:map>
Expand Down Expand Up @@ -136,7 +137,7 @@
https://www.w3.org/TR/xpath-functions-31/#func-transform -->
<xsl:sequence select="transform($runtime)?output"/>
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="true">End of step { count(.|preceding-sibling::*) }: XSLT { $xslt-spec }, document {$home/base-uri() => replace('.*/','')} ... </xsl:with-param>
<xsl:with-param name="msg" expand-text="true">Step { count(.|preceding-sibling::*) } end : document { $home-filename }, XSLT { $xslt-spec }</xsl:with-param>
</xsl:call-template>
</xsl:template>

Expand All @@ -145,7 +146,7 @@
<xsl:template mode="opr:execute" match="opr:terminate-if-severe-errors">
<xsl:param name="sourcedoc" as="document-node()"/>
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="true">Applying step { count(.|preceding-sibling::*) }: checking for severe errors ... </xsl:with-param>
<xsl:with-param name="msg" expand-text="true">Step { count(.|preceding-sibling::*) } : document { $home-filename }, check for severe errors</xsl:with-param>
</xsl:call-template>
<xsl:for-each select="$sourcedoc/descendant::processing-instruction('message-handler')[starts-with(.,$terminating-message)]">
<xsl:message terminate="yes" expand-text="yes">{.}</xsl:message>
Expand All @@ -158,8 +159,7 @@
<xsl:template mode="opr:execute" match="opr:finalize">
<xsl:param name="sourcedoc" as="document-node()"/>
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="true">Applying step {
count(.|preceding-sibling::*) }: finalize ... </xsl:with-param>
<xsl:with-param name="msg" expand-text="true">Step { count(.|preceding-sibling::*) } : document { $home-filename }, finalize</xsl:with-param>
</xsl:call-template>

<xsl:apply-templates select="$sourcedoc" mode="opr:finalize"/>
Expand All @@ -169,7 +169,7 @@
<xsl:template mode="opr:execute" match="*">
<xsl:param name="sourcedoc" as="document-node()"/>
<xsl:call-template name="alert">
<xsl:with-param name="msg" expand-text="true"> ... applied step { count(.|preceding-sibling::*) }: { name() } ...</xsl:with-param>
<xsl:with-param name="msg" expand-text="true">Step { count(.|preceding-sibling::*) } : { name() }</xsl:with-param>
</xsl:call-template>
<xsl:sequence select="$sourcedoc"/>
</xsl:template>
Expand Down

0 comments on commit f8f5941

Please sign in to comment.