aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-29 19:01:55 +0100
committerAdrian Kummerlaender2014-10-29 19:01:55 +0100
commit6a71a56fec2d0dc6465a1e24b8c8d24d629148f5 (patch)
treec635629e562e439fec2604d137910b583b39e8d1 /src
parent1b1d2cec7638e7af08c5cff2c0799aa9605fb58d (diff)
downloadStaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar.gz
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar.bz2
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar.lz
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar.xz
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.tar.zst
StaticXSLT-6a71a56fec2d0dc6465a1e24b8c8d24d629148f5.zip
Added check for successful transformation read in generate task
* this was not checked previously and was hard to diagnose because it only became visible when the queries failed
Diffstat (limited to 'src')
-rw-r--r--src/steps/process.xsl17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/steps/process.xsl b/src/steps/process.xsl
index 9b9552a..51e810e 100644
--- a/src/steps/process.xsl
+++ b/src/steps/process.xsl
@@ -168,8 +168,17 @@
<xsl:template name="process">
<xsl:param name="task"/>
- <xsl:variable name="transformation" select="InputXSLT:read-file($task/source)/self::file/xsl:stylesheet"/>
- <xsl:variable name="meta" select="$transformation/self::xsl:stylesheet/xsl:variable[@name = 'meta']"/>
+ <xsl:variable name="transformation" select="InputXSLT:read-file($task/source)/self::file"/>
+
+ <xsl:if test="$transformation/@result = 'error'">
+ <xsl:message terminate="yes">
+ <xsl:text>Failed to read transformation "</xsl:text>
+ <xsl:value-of select="$task/source"/>
+ <xsl:text>"</xsl:text>
+ </xsl:message>
+ </xsl:if>
+
+ <xsl:variable name="meta" select="$transformation/xsl:stylesheet/xsl:variable[@name = 'meta']"/>
<xsl:variable name="main_source" select="$meta/*[local-name() = 'datasource' and @type = 'main']"/>
<xsl:variable name="support_source" select="$meta/*[local-name() = 'datasource' and @type = 'support']"/>
<xsl:variable name="target" select="$meta/*[local-name() = 'target']"/>
@@ -186,7 +195,7 @@
</xsl:element>
</xsl:with-param>
<xsl:with-param name="support" select="$support_source"/>
- <xsl:with-param name="transformation" select="$transformation"/>
+ <xsl:with-param name="transformation" select="$transformation/xsl:stylesheet"/>
<xsl:with-param name="datasource_prefix" select="$task/meta/datasource_prefix"/>
<xsl:with-param name="target_prefix" select="$task/target"/>
<xsl:with-param name="target" select="$target"/>
@@ -219,7 +228,7 @@
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="support" select="$support_source"/>
- <xsl:with-param name="transformation" select="$transformation"/>
+ <xsl:with-param name="transformation" select="$transformation/xsl:stylesheet"/>
<xsl:with-param name="datasource_prefix" select="$task/meta/datasource_prefix"/>
<xsl:with-param name="target_prefix" select="$task/target"/>
<xsl:with-param name="target" select="$target"/>