Skip to content

Commit

Permalink
Prevent error in output when using JSON parameter
Browse files Browse the repository at this point in the history
Previously, if `file` was not specified (and `json` was), an error would
be emitted about the file not being found. This was erroneous as only
the JSON input should have been considered. This applies a small fix to
remediate that, given by Wendell in usnistgov/OSCAL#1849.

I am unsure whether this is the desired long-term fix but I figured
opening a PR to memorialize the patch may be useful.

Co-authored-by: Wendell Piez <[email protected]>
  • Loading branch information
Kyle Laker and wendellpiez committed Jul 12, 2023
1 parent a36f579 commit 46dd139
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

<!-- -->
<XSLT:template name="from-json">
<XSLT:if test="not(unparsed-text-available($file))" expand-text="true">
<XSLT:if test="matches($file, '\S') and not(unparsed-text-available($file))" expand-text="true">
<nm:ERROR>No file found at { $file }</nm:ERROR>
</XSLT:if>
<XSLT:variable name="source">
Expand Down

0 comments on commit 46dd139

Please sign in to comment.