aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-09-03 21:57:58 +0200
committerAdrian Kummerlaender2014-09-03 21:57:58 +0200
commit8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c (patch)
treec76795e8e09e63fdca3ea4b689fb654de8db80c8
parent6150e834e72000dfd4005789d3a1ef9b542802f1 (diff)
downloadblog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar.gz
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar.bz2
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar.lz
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar.xz
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.tar.zst
blog.kummerlaender.eu-8769770a39b7ad8fc9f2911e9a5956c2dfbf6e8c.zip
Restructured main datasource mode processing
* as both the "expression" and "full" mode require only a single call to the "compile" helper template they where merged ** this enabled us to completly remove the fallback call to "compile" * this outer choose statement decides between the "iterate" mode and single call modes
-rw-r--r--process.xsl44
1 files changed, 15 insertions, 29 deletions
diff --git a/process.xsl b/process.xsl
index 82f4188..d013168 100644
--- a/process.xsl
+++ b/process.xsl
@@ -150,22 +150,6 @@
<xsl:variable name="support_source" select="$meta/datasource[@type = 'support']"/>
<xsl:choose>
- <xsl:when test="$main_source/@mode = 'full'">
- <xsl:call-template name="compile">
- <xsl:with-param name="main">
- <xsl:element name="{$main_source/@target}">
- <xsl:copy-of select="InputXSLT:read-file(
- concat($task/meta/datasource_prefix, '/', $main_source/@source)
- )/self::file/*/*"/>
- </xsl:element>
- </xsl:with-param>
- <xsl:with-param name="support" select="$support_source"/>
- <xsl:with-param name="transformation" select="$transformation"/>
- <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="$meta/target"/>
- </xsl:call-template>
- </xsl:when>
<xsl:when test="$main_source/@mode = 'iterate'">
<xsl:for-each select="InputXSLT:read-file(
concat($task/meta/datasource_prefix, '/', $main_source/@source)
@@ -184,12 +168,23 @@
</xsl:call-template>
</xsl:for-each>
</xsl:when>
- <xsl:when test="$main_source/@mode = 'expression'">
+ <xsl:otherwise>
<xsl:call-template name="compile">
<xsl:with-param name="main">
- <xsl:element name="{$main_source/@target}">
- <xsl:copy-of select="dyn:evaluate($main_source/@source)"/>
- </xsl:element>
+ <xsl:choose>
+ <xsl:when test="$main_source/@mode = 'full'">
+ <xsl:element name="{$main_source/@target}">
+ <xsl:copy-of select="InputXSLT:read-file(
+ concat($task/meta/datasource_prefix, '/', $main_source/@source)
+ )/self::file/*/*"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="$main_source/@mode = 'expression'">
+ <xsl:element name="{$main_source/@target}">
+ <xsl:copy-of select="dyn:evaluate($main_source/@source)"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
</xsl:with-param>
<xsl:with-param name="support" select="$support_source"/>
<xsl:with-param name="transformation" select="$transformation"/>
@@ -197,15 +192,6 @@
<xsl:with-param name="target_prefix" select="$task/target"/>
<xsl:with-param name="target" select="$meta/target"/>
</xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="compile">
- <xsl:with-param name="support" select="$support_source"/>
- <xsl:with-param name="transformation" select="$transformation"/>
- <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="$meta/target"/>
- </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>