aboutsummaryrefslogtreecommitdiff
path: root/datasource
diff options
context:
space:
mode:
Diffstat (limited to 'datasource')
-rw-r--r--datasource/entry.xsl33
1 files changed, 33 insertions, 0 deletions
diff --git a/datasource/entry.xsl b/datasource/entry.xsl
new file mode 100644
index 0000000..4ea6162
--- /dev/null
+++ b/datasource/entry.xsl
@@ -0,0 +1,33 @@
+<?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:include href="[utility/formatter.xsl]"/>
+
+<xsl:template name="entry">
+ <xsl:param name="file"/>
+
+ <entry handle="{$file/name}">
+ <xsl:choose>
+ <xsl:when test="$file/extension = '.md'">
+ <xsl:call-template name="formatter">
+ <xsl:with-param name="format">/usr/bin/markdown</xsl:with-param>
+ <xsl:with-param name="source" select="InputXSLT:read-file($file/full)/text()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$file/extension = '.xml'">
+ <xsl:copy-of select="InputXSLT:read-file($file/full)/*"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="InputXSLT:read-file($file/full)/text()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </entry>
+</xsl:template>
+
+</xsl:stylesheet>