aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-15 22:10:58 +0200
committerAdrian Kummerlaender2014-07-15 22:10:58 +0200
commit57fbbe9a4fc8a12acaad0092667575cd6a823abd (patch)
treeeb943f65423f95afcb8bd669ad4d944e8226bc21
parentf39407fd3946c5f3aa7883a1f3cc774ad5f7dd8a (diff)
downloadblog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar.gz
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar.bz2
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar.lz
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar.xz
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.tar.zst
blog.kummerlaender.eu-57fbbe9a4fc8a12acaad0092667575cd6a823abd.zip
Added "transform_in_context" helper template
* handles inclusion of the meta DOM in the input source of transformations called through that template ** i.e. simplifies transformation chaining
-rw-r--r--generate.xsl38
1 files changed, 24 insertions, 14 deletions
diff --git a/generate.xsl b/generate.xsl
index cba8bea..f307085 100644
--- a/generate.xsl
+++ b/generate.xsl
@@ -16,26 +16,36 @@
<xsl:include href="utility/transformer.xsl"/>
-<xsl:template match="meta">
+<xsl:variable name="context" select="/"/>
+
+<xsl:template name="transform_in_context">
+ <xsl:param name="input"/>
+ <xsl:param name="transformation"/>
+
<xsl:call-template name="transformer">
<xsl:with-param name="input">
<data>
- <xsl:copy-of select="."/>
- <xsl:call-template name="transformer">
- <xsl:with-param name="input">
- <data>
- <xsl:copy-of select="."/>
- <xsl:call-template name="transformer">
- <xsl:with-param name="input" select="."/>
- <xsl:with-param name="transformation">[source.xsl]</xsl:with-param>
- </xsl:call-template>
- </data>
- </xsl:with-param>
- <xsl:with-param name="transformation">[datasource.xsl]</xsl:with-param>
- </xsl:call-template>
+ <xsl:copy-of select="$context"/>
+ <xsl:copy-of select="$input"/>
</data>
</xsl:with-param>
+ <xsl:with-param name="transformation" select="$transformation"/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="meta">
+ <xsl:call-template name="transform_in_context">
<xsl:with-param name="transformation">[result.xsl]</xsl:with-param>
+ <xsl:with-param name="input">
+ <xsl:call-template name="transform_in_context">
+ <xsl:with-param name="transformation">[datasource.xsl]</xsl:with-param>
+ <xsl:with-param name="input">
+ <xsl:call-template name="transform_in_context">
+ <xsl:with-param name="transformation">[source.xsl]</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
</xsl:call-template>
</xsl:template>