-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
s1kd-validate: Add -T (--summary) option
Added a -T (--summary) option which prints out a summary with statistics on the number of documents that passed/failed validation after it completes. This is analogous to the -T option in s1kd-brexcheck and s1kd-appcheck.
- Loading branch information
Showing
6 changed files
with
107 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
version="1.0"> | ||
|
||
<xsl:output method="text"/> | ||
|
||
<xsl:template match="s1kdValidateReport"> | ||
<xsl:variable name="total" select="count(document)"/> | ||
<xsl:text>Total documents checked: </xsl:text> | ||
<xsl:value-of select="$total"/> | ||
<xsl:text> </xsl:text> | ||
<xsl:if test="$total > 0"> | ||
<xsl:variable name="errors" select="count(document/error)"/> | ||
<xsl:variable name="fail" select="count(document[error])"/> | ||
<xsl:variable name="pass" select="count(document[not(error)])"/> | ||
<xsl:text>Total errors: </xsl:text> | ||
<xsl:value-of select="$errors"/> | ||
<xsl:text> </xsl:text> | ||
<xsl:text>Total documents that pass the check: </xsl:text> | ||
<xsl:value-of select="$pass"/> | ||
<xsl:text> </xsl:text> | ||
<xsl:text>Total documents that fail the check: </xsl:text> | ||
<xsl:value-of select="$fail"/> | ||
<xsl:text> </xsl:text> | ||
<xsl:text>Percentage passed: </xsl:text> | ||
<xsl:value-of select="floor($pass div $total * 100)"/> | ||
<xsl:text>% </xsl:text> | ||
<xsl:text>Percentage failed: </xsl:text> | ||
<xsl:value-of select="ceiling($fail div $total * 100)"/> | ||
<xsl:text>% </xsl:text> | ||
</xsl:if> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |