diff options
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.xsl | 44 |
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> |