aboutsummaryrefslogtreecommitdiff
path: root/detail/summarize.xsl
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-12 12:57:01 +0200
committerAdrian Kummerlaender2014-10-12 12:57:01 +0200
commit22ed1ee6e63a496f1e56d8bd905542035d88ca2b (patch)
tree64f8eed3d7a80d9a69eacd08a7f9c9821d411934 /detail/summarize.xsl
parentd9784669ec613d42d453c907921a9983a36518fb (diff)
downloadblog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar.gz
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar.bz2
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar.lz
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar.xz
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.tar.zst
blog.kummerlaender.eu-22ed1ee6e63a496f1e56d8bd905542035d88ca2b.zip
Extracted generation framework into StaticXSLT module
* i.e. the `detail` transformations were moved into a BuildXSLT module * modified XML Makefile accordingly * removed framework documentation from `README.md` and added usage documentation * this was done to make it easier to use the basic static site generation framework in other projects ** the detail transformations were developed to enable the implementation of this blog but are generic enough to be used in other contexts
Diffstat (limited to 'detail/summarize.xsl')
-rw-r--r--detail/summarize.xsl75
1 files changed, 0 insertions, 75 deletions
diff --git a/detail/summarize.xsl b/detail/summarize.xsl
deleted file mode 100644
index 0399507..0000000
--- a/detail/summarize.xsl
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
-
-<xsl:output
- method="text"
- omit-xml-declaration="yes"
- encoding="UTF-8"
- indent="no"
-/>
-
-<xsl:template match="task[@result = 'error']">
- <xsl:text>&#xa;Error #</xsl:text>
- <xsl:value-of select="position()"/>
- <xsl:text>: </xsl:text>
-
- <xsl:choose>
- <xsl:when test="@type = 'generate'">
- <xsl:for-each select="subtask[@result = 'error']">
- <xsl:text>Generation of "</xsl:text>
- <xsl:value-of select="target"/>
- <xsl:text>" failed.</xsl:text>
-
- <xsl:for-each select="log/error">
- <xsl:text>&#xa;</xsl:text>
- <xsl:value-of select="."/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="@type = 'link'">
- <xsl:text>Link from "</xsl:text>
- <xsl:value-of select="from"/>
- <xsl:text>" to "</xsl:text>
- <xsl:value-of select="to"/>
- <xsl:text>" failed.</xsl:text>
- </xsl:when>
- <xsl:when test="@type = 'clean'">
- <xsl:text>Cleaning of "</xsl:text>
- <xsl:value-of select="path"/>
- <xsl:text>" failed.</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="datasource">
- <xsl:variable name="total_count" select="count(task)"/>
- <xsl:variable name="success_count" select="count(task[@result = 'success'])"/>
-
- <xsl:text>Tasks processed: </xsl:text>
- <xsl:value-of select="$total_count"/>
- <xsl:text>&#xa;</xsl:text>
- <xsl:text>Tasks successful: </xsl:text>
- <xsl:value-of select="$success_count"/>
- <xsl:text>&#xa;</xsl:text>
-
- <xsl:text>▶ Generation </xsl:text>
- <xsl:choose>
- <xsl:when test="$total_count = $success_count">
- <xsl:text>successful</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>failed</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>.&#xa;</xsl:text>
-
- <xsl:apply-templates select="task[@result = 'error']"/>
-</xsl:template>
-
-</xsl:stylesheet>