diff options
Added meta datasource
* merges the content of the "00_content/meta.xml" file with additional data such as the available tags
* simplifies providing a basic datasource to every result transformation
* modified master, article and tag page template accordingly
Diffstat (limited to 'source')
-rw-r--r-- | source/03_meta/meta.xsl | 39 | ||||
-rw-r--r-- | source/99_result/article/article.xsl | 3 | ||||
-rw-r--r-- | source/99_result/tag/tag.xsl | 5 |
3 files changed, 42 insertions, 5 deletions
diff --git a/source/03_meta/meta.xsl b/source/03_meta/meta.xsl new file mode 100644 index 0000000..75baa1d --- /dev/null +++ b/source/03_meta/meta.xsl @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xalan="http://xml.apache.org/xalan" + xmlns:InputXSLT="function.inputxslt.application" + exclude-result-prefixes="xalan InputXSLT" +> + +<xsl:output + method="xml" + omit-xml-declaration="no" + encoding="UTF-8" + indent="yes" +/> + +<xsl:include href="[utility/datasource.xsl]"/> + +<xsl:variable name="meta"> + <datasource type="main" mode="full" source="source/00_content/meta.xml" target="meta"/> + <datasource type="support" mode="full" source="target/02_data/tags.xml" target="tags"/> + <target mode="plain" value="meta.xml"/> +</xsl:variable> + +<xsl:template match="meta"> + <xsl:copy-of select="./*"/> +</xsl:template> + +<xsl:template match="tags"> + <tags> + <xsl:apply-templates /> + </tags> +</xsl:template> + +<xsl:template match="tags/entry"> + <entry handle="{@handle}"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/source/99_result/article/article.xsl b/source/99_result/article/article.xsl index 8801a60..9c5cd3e 100644 --- a/source/99_result/article/article.xsl +++ b/source/99_result/article/article.xsl @@ -19,8 +19,7 @@ <xsl:variable name="meta"> <datasource type="main" mode="iterate" source="target/02_data/articles.xml" target="article"/> - <datasource type="support" mode="full" source="source/00_content/meta.xml" target="meta"/> - <datasource type="support" mode="full" source="target/02_data/tags.xml" target="tags"/> + <datasource type="support" mode="full" source="target/03_meta/meta.xml" target="meta"/> <target mode="xpath" value="xalan:nodeset($datasource)/datasource/article/entry/@handle"/> </xsl:variable> diff --git a/source/99_result/tag/tag.xsl b/source/99_result/tag/tag.xsl index 6ab11bf..0ed3007 100644 --- a/source/99_result/tag/tag.xsl +++ b/source/99_result/tag/tag.xsl @@ -18,9 +18,8 @@ <xsl:include href="[utility/date-time.xsl]"/> <xsl:variable name="meta"> - <datasource type="main" mode="iterate" source="target/03_meta/tags.xml" target="tag"/> - <datasource type="support" mode="full" source="source/00_content/meta.xml" target="meta"/> - <datasource type="support" mode="full" source="target/02_data/tags.xml" target="tags"/> + <datasource type="main" mode="iterate" source="target/03_meta/tags.xml" target="tag"/> + <datasource type="support" mode="full" source="target/03_meta/meta.xml" target="meta"/> <target mode="xpath" value="xalan:nodeset($datasource)/datasource/tag/entry/@handle"/> </xsl:variable> |