implemented finding count placeholder
This commit is contained in:
parent
a401806ea1
commit
964b655c84
@ -1,6 +1,13 @@
|
||||
RELEASE NOTES
|
||||
=============
|
||||
|
||||
March 29th, 2017
|
||||
----------------
|
||||
|
||||
### Finding Count placeholders
|
||||
|
||||
In reports, you now have access to the `<finding_count>` placeholder. It takes an optional attribute `@threatLevel` and returns the number of findings with that threatLevel in the report. If no `@threatLevel` attribute is added, it returns the total number of findings in the report. Useful for Results in a Nutshell type of texts.
|
||||
|
||||
March 20th, 2017
|
||||
----------------
|
||||
|
||||
|
||||
@ -193,6 +193,20 @@
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
|
||||
<xs:attribute name="threatLevel" default="N/A">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="N/A"/>
|
||||
<xs:enumeration value="Unknown"/>
|
||||
<xs:enumeration value="Low"/>
|
||||
<xs:enumeration value="Moderate"/>
|
||||
<xs:enumeration value="Elevated"/>
|
||||
<xs:enumeration value="High"/>
|
||||
<xs:enumeration value="Extreme"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
|
||||
<xs:element name="non-finding">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@ -263,19 +277,7 @@
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="required" type="xs:ID"/>
|
||||
<xs:attribute name="threatLevel" use="optional" default="N/A">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="N/A"/>
|
||||
<xs:enumeration value="Unknown"/>
|
||||
<xs:enumeration value="Low"/>
|
||||
<xs:enumeration value="Moderate"/>
|
||||
<xs:enumeration value="Elevated"/>
|
||||
<xs:enumeration value="High"/>
|
||||
<xs:enumeration value="Extreme"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute ref="threatLevel" use="optional" default="N/A"/>
|
||||
<xs:attribute name="status" use="optional">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
@ -380,6 +382,11 @@
|
||||
<xs:element name="p_testingduration"/>
|
||||
<xs:element name="p_reportwritingduration"/>
|
||||
<xs:element name="p_reportdue"/>
|
||||
<xs:element name="finding_count">
|
||||
<xs:complexType>
|
||||
<xs:attribute ref="threatLevel" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
|
||||
</xs:group>
|
||||
|
||||
@ -59,7 +59,8 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="client_rate">
|
||||
<xsl:param name="roleTitle" select="@title"/>
|
||||
<xsl:param name="placeholderElement" select="/*/meta//client/rates/rate[@title=$roleTitle]"/>
|
||||
<xsl:param name="placeholderElement"
|
||||
select="/*/meta//client/rates/rate[@title = $roleTitle]"/>
|
||||
<xsl:call-template name="checkPlaceholder">
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
@ -345,6 +346,12 @@
|
||||
<xsl:with-param name="placeholderElement" select="$placeholderElement"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="finding_count">
|
||||
<xsl:param name="threatLevel" select="@threatLevel"/>
|
||||
<xsl:value-of select="count(//finding[@threatLevel=$threatLevel])" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="checkPlaceholder">
|
||||
<xsl:param name="placeholderElement" select="/"/>
|
||||
<xsl:param name="caps" select="'none'"/>
|
||||
@ -362,7 +369,8 @@
|
||||
<xsl:variable name="fee" select="$placeholderElement * 1"/>
|
||||
<xsl:number value="$fee" grouping-separator="," grouping-size="3"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="self::contract_end_date or self::contract_start_date or self::generate_raterevisiondate">
|
||||
<xsl:when
|
||||
test="self::contract_end_date or self::contract_start_date or self::generate_raterevisiondate">
|
||||
<!-- pretty printing for date -->
|
||||
<xsl:value-of
|
||||
select="format-date($placeholderElement, '[MNn] [D1], [Y]', 'en', (), ())"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user