aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-25 21:17:15 +0200
committerAdrian Kummerlaender2014-07-25 21:17:15 +0200
commitc0cd6ee34a0ed1290acdf6058d1dea8437a8dcff (patch)
tree1a0b2cb5ae32d12b2bfb18919ab6da9ddfadc94a
parent5f2a0418701d8e483a54d9b354c9c5ee59a52b7e (diff)
downloadblog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar.gz
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar.bz2
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar.lz
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar.xz
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.tar.zst
blog.kummerlaender.eu-c0cd6ee34a0ed1290acdf6058d1dea8437a8dcff.zip
Added root variable to datasource template
* this was done to simplifiy support data queries while resolving the main datasource
-rw-r--r--source/02_data/articles.xsl2
-rw-r--r--source/03_meta/tags.xsl2
-rw-r--r--utility/datasource.xsl2
3 files changed, 4 insertions, 2 deletions
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 7547cc7..bc41137 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -25,7 +25,7 @@
<xsl:template name="list_tags">
<xsl:param name="path"/>
- <xsl:for-each select="../../tags/*[./file/full = $path]">
+ <xsl:for-each select="$root/files/tags/*[./file/full = $path]">
<tag><xsl:value-of select="name()"/></tag>
</xsl:for-each>
</xsl:template>
diff --git a/source/03_meta/tags.xsl b/source/03_meta/tags.xsl
index 4bed65c..f51f91a 100644
--- a/source/03_meta/tags.xsl
+++ b/source/03_meta/tags.xsl
@@ -25,7 +25,7 @@
<xsl:template name="get_article_data">
<xsl:param name="handle"/>
- <xsl:copy-of select="ancestor::node()[4]/articles/entry[@handle = $handle]/*[self::title | self::date]"/>
+ <xsl:copy-of select="$root/articles/entry[@handle = $handle]/*[self::title | self::date]"/>
</xsl:template>
<xsl:template match="files/tags/*">
diff --git a/utility/datasource.xsl b/utility/datasource.xsl
index 8ce224c..5b0d4a5 100644
--- a/utility/datasource.xsl
+++ b/utility/datasource.xsl
@@ -14,6 +14,8 @@
indent="yes"
/>
+<xsl:variable name="root" select="/datasource"/>
+
<xsl:template match="/">
<datasource>
<xsl:apply-templates />