aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-29 23:04:13 +0200
committerAdrian Kummerlaender2014-08-29 23:04:13 +0200
commitdc7c9280dabd9d2a512ddd4a1b00213367f81c3d (patch)
treeea6fbdc17861a3eb22dac0d6819e1b57fef13283
parent14fa96aa3f663b45ebe6b4642e1af00dba8602e7 (diff)
downloadblog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar.gz
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar.bz2
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar.lz
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar.xz
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.tar.zst
blog.kummerlaender.eu-dc7c9280dabd9d2a512ddd4a1b00213367f81c3d.zip
Extracted task counters into variables
* counter value for total and successful tasks moved into named variables ** this improves readability of success summarization logic
-rw-r--r--process.xsl5
1 files changed, 4 insertions, 1 deletions
diff --git a/process.xsl b/process.xsl
index 0580fa2..29efc0e 100644
--- a/process.xsl
+++ b/process.xsl
@@ -201,10 +201,13 @@
</xsl:call-template>
</xsl:variable>
+ <xsl:variable name="total_count" select="count(xalan:nodeset($results)/subtask)"/>
+ <xsl:variable name="success_count" select="count(xalan:nodeset($results)/subtask[@result = 'success'])"/>
+
<xsl:copy>
<xsl:attribute name="result">
<xsl:choose>
- <xsl:when test="count(xalan:nodeset($results)/subtask[@result = 'success']) = count(xalan:nodeset($results)/subtask)">
+ <xsl:when test="$success_count = $total_count">
<xsl:text>success</xsl:text>
</xsl:when>
<xsl:otherwise>