Merge pull request #72 from PeterMosmans/fix-count

Allow finding_count to use (multiple) status attribute values
This commit is contained in:
Patricia Piolon 2019-09-26 19:48:58 +02:00 committed by GitHub
commit c36f63c401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -415,6 +415,7 @@
<xs:element name="finding_count"> <xs:element name="finding_count">
<xs:complexType> <xs:complexType>
<xs:attribute ref="threatLevel" use="optional"/> <xs:attribute ref="threatLevel" use="optional"/>
<xs:attribute ref="status" use="optional"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="todo"/> <xs:element name="todo"/>

View File

@ -466,7 +466,14 @@
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="count(//finding)"/> <xsl:choose>
<xsl:when test="$statusSequence">
<xsl:value-of select="count(//finding[@status = $statusSequence])"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count(//finding)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>